-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a deployment script that creates a file containing details on w…
…hat git commit was used.
- Loading branch information
Richard Liang
committed
Jan 16, 2024
1 parent
6fdba76
commit bd8a62b
Showing
3 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Use rsync to copy the cluster setup code to a target server. | ||
|
||
# Command-line parameters: | ||
# prod|test | ||
# e.g. | ||
# ./deploy_cluster_setup.sh prod | ||
|
||
# If you need to override the default login/server or upload path, set | ||
# the environment variables CLUSTER_SETUP_LOGIN and/or CLUSTER_SETUP_PATH. | ||
# Check out the version of the code you want before running, as this script | ||
# does not check out a fresh repository; we want this script to transfer over | ||
# config files that would not be in a stock repo. | ||
|
||
# Make sure you have (or the account you log into the server with has) appropriate | ||
# permissions on the deployment path. | ||
|
||
prod_or_test=$1 | ||
|
||
echo "Deployed tag/commit/branch $git_tag on $(date)." > deployment_notes.txt | ||
echo 'Output of "git describe":' >> deployment_notes.txt | ||
git describe --tags >> deployment_notes.txt | ||
echo 'Output of "git show --format=oneline --no-patch":' >> deployment_notes.txt | ||
git show --format=oneline --no-patch >> deployment_notes.txt | ||
|
||
if [ "$prod_or_test" == "prod" ]; then | ||
server="kive-int.cfenet.ubc.ca" | ||
else | ||
server="testkive-int.cfenet.ubc.ca" | ||
fi | ||
server_login=${CLUSTER_SETUP_LOGIN:-"${USER}@${server}"} | ||
|
||
deployment_path=${CLUSTER_SETUP_PATH:-"/usr/local/src/cluster-setup"} | ||
|
||
rsync -avz --exclude-from deploy_exclude_list.txt -a ./ ${server_login}:${deployment_path} | ||
|
||
echo "... done." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
deployment/group_vars/all.yml | ||
deployment/group_vars/all.yaml | ||
deployment/ansible.cfg | ||
initialization/worker/head_node_root_id_ed25519.pub |