9
9
# It has been written with the intention of being run from GitHub Actions as
10
10
# part of our CI/CD process. It therefore assumes that the following
11
11
# environment variables will be set:
12
- # - DEPLOY_IP_ADDRESS -- The IP address of the instance to run the deploy on.
12
+ # - DEPLOY_BOX_IP -- The IP address of the instance to run the deploy on.
13
13
# - CI_TAG -- The tag that was pushed to GitHub to trigger the deploy.
14
14
# Will be used as the version for the system and the tag for Docker images.
15
- # - DOCKER_ID -- The username that will be used to log into Dockerhub.
16
- # - DOCKER_PASSWD -- The password that will be used to log into Dockerhub.
17
- # - OPENSSL_KEY -- The OpenSSl key which will be used to decrypt the SSH key.
15
+ # - DOCKER_USERNAME -- The username that will be used to log into Dockerhub.
16
+ # - DOCKER_PASSWORD -- The password that will be used to log into Dockerhub.
17
+ # - OPENSSL_KEY -- The OpenSSL key which will be used to decrypt the SSH key.
18
18
# - AWS_ACCESS_KEY_ID -- The AWS key id to use when interacting with AWS.
19
19
# - AWS_SECRET_ACCESS_KEY -- The AWS secret key to use when interacting with AWS.
20
20
21
- echo " $INSTANCE_SSH_KEY " > infrastructure/data-refinery-key.pem
21
+ echo " $DEPLOY_BOX_SSH_PRIVATE_KEY " > infrastructure/data-refinery-key.pem
22
22
chmod 600 infrastructure/data-refinery-key.pem
23
23
24
24
run_on_deploy_box () {
25
25
# shellcheck disable=SC2029
26
26
ssh -o StrictHostKeyChecking=no \
27
27
-o ServerAliveInterval=15 \
28
28
-i infrastructure/data-refinery-key.pem \
29
- ubuntu@" ${DEPLOY_IP_ADDRESS } " \
29
+ ubuntu@" ${DEPLOY_BOX_IP } " \
30
30
" cd refinebio && $1 "
31
31
}
32
32
33
33
# Create file containing local env vars that are needed for deploy.
34
34
rm -f env_vars
35
35
cat >> env_vars << EOF
36
36
export CI_TAG='$CI_TAG '
37
- export DOCKER_ID ='$DOCKER_ID '
38
- export DOCKER_PASSWD ='$DOCKER_PASSWD '
37
+ export DOCKER_USERNAME ='$DOCKER_USERNAME '
38
+ export DOCKER_PASSWORD ='$DOCKER_PASSWORD '
39
39
export OPENSSL_KEY='$OPENSSL_KEY '
40
40
export AWS_ACCESS_KEY_ID='$AWS_ACCESS_KEY_ID '
41
41
export AWS_SECRET_ACCESS_KEY='$AWS_SECRET_ACCESS_KEY '
42
42
export TF_VAR_database_password='$DATABASE_PASSWORD '
43
43
export TF_VAR_django_secret_key='$DJANGO_SECRET_KEY '
44
- export TF_VAR_raven_dsn ='$RAVEN_DSN '
45
- export TF_VAR_raven_dsn_api ='$RAVEN_DSN_API '
46
- export TF_VAR_engagementbot_webhook ='$ENGAGEMENTBOT_WEBHOOK '
44
+ export TF_VAR_sentry_dsn ='$SENTRY_DSN '
45
+ export TF_VAR_slack_webhook_url ='$SLACK_WEBHOOK_URL '
46
+ export TF_VAR_ssh_public_key ='$SSH_PUBLIC_KEY '
47
47
EOF
48
48
49
49
# And checkout the correct tag.
@@ -56,12 +56,12 @@ run_on_deploy_box "bash .github/scripts/verify_tag.sh $CI_TAG"
56
56
# Copy the necessary environment variables over.
57
57
scp -o StrictHostKeyChecking=no \
58
58
-i infrastructure/data-refinery-key.pem \
59
- -r env_vars ubuntu@" $DEPLOY_IP_ADDRESS " :refinebio/env_vars
59
+ -r env_vars ubuntu@" $DEPLOY_BOX_IP " :refinebio/env_vars
60
60
61
61
# Along with the ssh key iself, which the deploy script will use.
62
62
scp -o StrictHostKeyChecking=no \
63
63
-i infrastructure/data-refinery-key.pem \
64
- -r infrastructure/data-refinery-key.pem ubuntu@" $DEPLOY_IP_ADDRESS " :refinebio/infrastructure/data-refinery-key.pem
64
+ -r infrastructure/data-refinery-key.pem ubuntu@" $DEPLOY_BOX_IP " :refinebio/infrastructure/data-refinery-key.pem
65
65
66
66
echo " Building new images"
67
67
# Output to the docker update log.
0 commit comments