Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ node_modules/
release/*/*/build/
sample/*/*/build/
experimental/*/*/build/
servervars.sh
.cache
*.kpj.user

Expand Down
1 change: 0 additions & 1 deletion ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ else
APP7Z="/c/Program Files/7-Zip/7z.exe"
fi

. "$MODELROOT/servervars.sh"
. "$MODELROOT/resources/util.inc.sh"
. "$MODELROOT/resources/rsync-tools.inc.sh"

Expand Down
59 changes: 59 additions & 0 deletions resources/teamcity/models/models-build-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/usr/bin/env bash
# Keyman is copyright (C) SIL Global. MIT License.

# shellcheck disable=SC2164
# shellcheck disable=SC1091

## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../../../resources/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

################################ Main script ################################

builder_describe \
"Build and deploy models" \
"all run all actions" \
"build build models" \
"publish deploy models" \
"--downloads-keyman-com=DOWNLOADS_KEYMAN_COM_URL URL of downloads server" \
"--rsync-path=REMOTE_RSYNC_PATH Path to rsync on remote server" \
"--rsync-dest=RSYNC_DEST Destination for rsync"
Comment on lines +20 to +22
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Do these variables need to be exported in order for them to be available to ci.sh?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


builder_parse "$@"

export DOWNLOADS_KEYMAN_COM_URL
export REMOTE_RSYNC_PATH
export RSYNC_DEST

function do_build() {
builder_echo "Building all models"
"${REPO_ROOT}/build.sh" configure build test
builder_echo "Finished building all models"
}

function do_publish() {
if [[ -z "${DOWNLOADS_KEYMAN_COM_URL+x}" ]]; then
builder_die "Option --downloads-keyman-com must be specified for publish action"
fi
if [[ -z "${REMOTE_RSYNC_PATH+x}" ]]; then
builder_die "Option --rsync-path must be specified for publish action"
fi
if [[ -z "${RSYNC_DEST+x}" ]]; then
builder_die "Option --rsync-dest must be specified for publish action"
fi
builder_echo "Uploading models to downloads.keyman.com"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
builder_echo "Uploading models to downloads.keyman.com"
if [[ -z "${DOWNLOADS_KEYMAN_COM_URL+x}" ]]; then
builder_die "Option --downloads-keyman-com must be specified for publish action"
fi
if [[ -z "${REMOTE_RSYNC_PATH+x}" ]]; then
builder_die "Option --rsync-path must be specified for publish action"
fi
if [[ -z "${RSYNC_DEST+x}" ]]; then
builder_die "Option --rsync-dest must be specified for publish action"
fi
builder_echo "Uploading models to downloads.keyman.com"

"${REPO_ROOT}/ci.sh"
builder_echo "Finished uploading models to downloads.keyman.com"
}

cd "${REPO_ROOT}"

if builder_has_action all; then
do_build
do_publish
else
builder_run_action build do_build
builder_run_action publish do_publish
fi
29 changes: 29 additions & 0 deletions resources/teamcity/models/models-test-prs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Keyman is copyright (C) SIL Global. MIT License.

# shellcheck disable=SC2164
# shellcheck disable=SC1091

## START STANDARD BUILD SCRIPT INCLUDE
# adjust relative paths as necessary
THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")"
. "${THIS_SCRIPT%/*}/../../../resources/builder.inc.sh"
## END STANDARD BUILD SCRIPT INCLUDE

################################ Main script ################################

builder_describe \
"Test build of pull request" \
"all run all actions"

builder_parse "$@"

function do_build() {
builder_echo "Building all models"
"${REPO_ROOT}/build.sh" configure build test
builder_echo "Finished building all models"
}

cd "${REPO_ROOT}"

builder_run_action all do_build