Skip to content

Commit 3cd73b0

Browse files
authored
Merge pull request #3391 from AlexsLemonade/ark/1password-integration
Use 1Password as a secrets storage
2 parents bc365b2 + 439899b commit 3cd73b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+384
-286
lines changed

.github/scripts/post_deploy_cleanup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ set -e
1010
ssh -o StrictHostKeyChecking=no \
1111
-o ServerAliveInterval=15 \
1212
-i infrastructure/data-refinery-key.pem \
13-
"ubuntu@${DEPLOY_IP_ADDRESS}" \
13+
"ubuntu@${DEPLOY_BOX_IP}" \
1414
"cd refinebio && git clean -f"

.github/scripts/remote_deploy.sh

+13-13
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,41 @@
99
# It has been written with the intention of being run from GitHub Actions as
1010
# part of our CI/CD process. It therefore assumes that the following
1111
# 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.
1313
# - CI_TAG -- The tag that was pushed to GitHub to trigger the deploy.
1414
# 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.
1818
# - AWS_ACCESS_KEY_ID -- The AWS key id to use when interacting with AWS.
1919
# - AWS_SECRET_ACCESS_KEY -- The AWS secret key to use when interacting with AWS.
2020

21-
echo "$INSTANCE_SSH_KEY" >infrastructure/data-refinery-key.pem
21+
echo "$DEPLOY_BOX_SSH_PRIVATE_KEY" >infrastructure/data-refinery-key.pem
2222
chmod 600 infrastructure/data-refinery-key.pem
2323

2424
run_on_deploy_box() {
2525
# shellcheck disable=SC2029
2626
ssh -o StrictHostKeyChecking=no \
2727
-o ServerAliveInterval=15 \
2828
-i infrastructure/data-refinery-key.pem \
29-
ubuntu@"${DEPLOY_IP_ADDRESS}" \
29+
ubuntu@"${DEPLOY_BOX_IP}" \
3030
"cd refinebio && $1"
3131
}
3232

3333
# Create file containing local env vars that are needed for deploy.
3434
rm -f env_vars
3535
cat >>env_vars <<EOF
3636
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'
3939
export OPENSSL_KEY='$OPENSSL_KEY'
4040
export AWS_ACCESS_KEY_ID='$AWS_ACCESS_KEY_ID'
4141
export AWS_SECRET_ACCESS_KEY='$AWS_SECRET_ACCESS_KEY'
4242
export TF_VAR_database_password='$DATABASE_PASSWORD'
4343
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'
4747
EOF
4848

4949
# And checkout the correct tag.
@@ -56,12 +56,12 @@ run_on_deploy_box "bash .github/scripts/verify_tag.sh $CI_TAG"
5656
# Copy the necessary environment variables over.
5757
scp -o StrictHostKeyChecking=no \
5858
-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
6060

6161
# Along with the ssh key iself, which the deploy script will use.
6262
scp -o StrictHostKeyChecking=no \
6363
-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
6565

6666
echo "Building new images"
6767
# Output to the docker update log.

.github/scripts/slackpost_deploy.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

3-
if [[ $ENGAGEMENTBOT_WEBHOOK == "" ]]; then
4-
echo "No webhook url. Set ENGAGEMENTBOT_WEBHOOK in the environment variables if you want to be notified of deploys on slack"
3+
if [[ $SLACK_WEBHOOK_URL == "" ]]; then
4+
echo "No webhook url. Set SLACK_WEBHOOK_URL in the environment variables if you want to be notified of deploys on slack"
55
exit 0
66
fi
77

@@ -36,4 +36,4 @@ escapedText=$(echo "$text" | sed 's/"/\"/g' | sed "s/'/\'/g")
3636

3737
json="{\"channel\": \"$channel\", \"username\":\"$username\", \"icon_emoji\":\":tada:\", \"attachments\":[{\"color\":\"danger\" , \"text\": \"$escapedText\"}]}"
3838

39-
curl -s -d "payload=$json" "$ENGAGEMENTBOT_WEBHOOK"
39+
curl -s -d "payload=$json" "$SLACK_WEBHOOK_URL"

.github/scripts/slackpost_end_to_end.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

3-
if [[ $ENGAGEMENTBOT_WEBHOOK == "" ]]; then
4-
echo "No webhook url. Set ENGAGEMENTBOT_WEBHOOK in the environment variables if you want to be notified of deploys on slack"
3+
if [[ $SLACK_WEBHOOK_URL == "" ]]; then
4+
echo "No webhook url. Set SLACK_WEBHOOK_URL in the environment variables if you want to be notified of deploys on slack"
55
exit 0
66
fi
77

@@ -26,4 +26,4 @@ escapedText=$(echo "$text" | sed 's/"/\"/g' | sed "s/'/\'/g")
2626

2727
json="{\"channel\": \"$channel\", \"username\":\"$username\", \"icon_emoji\":\":tada:\", \"attachments\":[{\"color\":\"danger\" , \"text\": \"$escapedText\"}]}"
2828

29-
curl -s -d "payload=$json" "$ENGAGEMENTBOT_WEBHOOK"
29+
curl -s -d "payload=$json" "$SLACK_WEBHOOK_URL"

0 commit comments

Comments
 (0)