-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,7 +88,7 @@ jobs: | |
DFC_IAC_DEPLOY_KEY: ${{ secrets.DFC_IAC_DEPLOY_KEY }} | ||
ANYWAY_ETL_DEPLOY_KEY: ${{ secrets.ANYWAY_ETL_DEPLOY_KEY }} | ||
run: | | ||
if [ "${GITHUB_REF}" == "refs/heads/master" ]; then | ||
if [ "${GITHUB_REF}" == "refs/heads/master" ] || [ "${GITHUB_REF}" == "refs/heads/dev" ]; then | ||
SHA_TAG=sha-`git rev-parse --short $GITHUB_SHA` &&\ | ||
echo SHA_TAG=$SHA_TAG &&\ | ||
ANYWAY_IMAGE="${DOCKER_REPOSITORY_ANYWAY}:${SHA_TAG}" &&\ | ||
|
@@ -100,24 +100,30 @@ jobs: | |
NGINX_IMAGE="${DOCKER_REPOSITORY_NGINX}:${SHA_TAG}" &&\ | ||
echo NGINX_IMAGE=$NGINX_IMAGE &&\ | ||
if ! git log -1 --pretty=format:"%s" | grep -- --no-deploy; then | ||
cd `mktemp -d` &&\ | ||
echo "${DFC_IAC_DEPLOY_KEY}" > dfc_iac_deploy_key &&\ | ||
chmod 400 dfc_iac_deploy_key &&\ | ||
export GIT_SSH_COMMAND="ssh -i `pwd`/dfc_iac_deploy_key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" &&\ | ||
git clone [email protected]:data-for-change/dfc-iac.git &&\ | ||
cd dfc-iac &&\ | ||
bin/update_anyway_env.py '{"image":"'${ANYWAY_IMAGE}'","dbImage":"'${DB_IMAGE}'","dbBackupImage":"'${DB_BACKUP_IMAGE}'","nginxImage":"'${NGINX_IMAGE}'"}' &&\ | ||
git config --global user.name "Anyway CI" &&\ | ||
git config --global user.email "anyway-ci@localhost" &&\ | ||
git add apps/anyway/.env && git commit -m "automatic update of anyway" | ||
git push origin main &&\ | ||
if [ "${GITHUB_REF}" == "refs/heads/master" ]; then | ||
cd `mktemp -d` &&\ | ||
echo "${DFC_IAC_DEPLOY_KEY}" > dfc_iac_deploy_key &&\ | ||
chmod 400 dfc_iac_deploy_key &&\ | ||
export GIT_SSH_COMMAND="ssh -i `pwd`/dfc_iac_deploy_key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" &&\ | ||
git clone [email protected]:data-for-change/dfc-iac.git &&\ | ||
cd dfc-iac &&\ | ||
bin/update_anyway_env.py '{"image":"'${ANYWAY_IMAGE}'","dbImage":"'${DB_IMAGE}'","dbBackupImage":"'${DB_BACKUP_IMAGE}'","nginxImage":"'${NGINX_IMAGE}'"}' &&\ | ||
git config --global user.name "Anyway CI" &&\ | ||
git config --global user.email "anyway-ci@localhost" &&\ | ||
git add apps/anyway/.env && git commit -m "automatic update of anyway" | ||
git push origin main | ||
fi &&\ | ||
cd `mktemp -d` &&\ | ||
echo "${ANYWAY_ETL_DEPLOY_KEY}" > anyway_etl_deploy_key &&\ | ||
chmod 400 anyway_etl_deploy_key &&\ | ||
export GIT_SSH_COMMAND="ssh -i `pwd`/anyway_etl_deploy_key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" &&\ | ||
git clone [email protected]:data-for-change/anyway-etl.git &&\ | ||
cd anyway-etl &&\ | ||
ANYWAY_ETL_COMMIT_FILENAME=anyway-master-commit.txt | ||
if [ "${GITHUB_REF}" == "refs/heads/dev" ]; then | ||
ANYWAY_ETL_COMMIT_FILENAME=anyway-dev-commit.txt | ||
else | ||
ANYWAY_ETL_COMMIT_FILENAME=anyway-master-commit.txt | ||
fi &&\ | ||
echo "${GITHUB_SHA}" > $ANYWAY_ETL_COMMIT_FILENAME &&\ | ||
git add ./$ANYWAY_ETL_COMMIT_FILENAME &&\ | ||
git commit -m "automatic update of $ANYWAY_ETL_COMMIT_FILENAME" &&\ | ||
|