-
Notifications
You must be signed in to change notification settings - Fork 7
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
9 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 |
---|---|---|
|
@@ -11,7 +11,7 @@ jobs: | |
NGINX_IMAGE_NAME: "ghcr.io/data-for-change/anyway-etl/anyway-etl-nginx" | ||
AIRFLOW_IMAGE_NAME: "ghcr.io/data-for-change/anyway-etl/anyway-etl-airflow" | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
DFC_K8S_DEPLOY_KEY: ${{ secrets.DFC_K8S_DEPLOY_KEY }} | ||
DFC_IAC_DEPLOY_KEY: ${{ secrets.DFC_IAC_DEPLOY_KEY }} | ||
run: | | ||
if [[ "${GITHUB_REF}" =~ ^refs/tags/.* ]]; then | ||
TAG_NAME="${GITHUB_REF/refs\/tags\//}" | ||
|
@@ -57,20 +57,16 @@ jobs: | |
docker push "${NGINX_IMAGE_NAME}:${PUSH_TAG}" &&\ | ||
if [ "${TAG_NAME}" != "" ] || bin/ci_check_allow_deploy.sh; then | ||
cd `mktemp -d` &&\ | ||
echo "${DFC_K8S_DEPLOY_KEY}" > dfc_k8s_deploy_key &&\ | ||
chmod 400 dfc_k8s_deploy_key &&\ | ||
export GIT_SSH_COMMAND="ssh -i `pwd`/dfc_k8s_deploy_key -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" &&\ | ||
git clone [email protected]:data-for-change/dfc-k8s.git &&\ | ||
cd dfc-k8s &&\ | ||
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 &&\ | ||
git config --global user.name "Anyway ETL CI" &&\ | ||
git config --global user.email "anyway-etl-ci@localhost" &&\ | ||
if [ "${TAG_NAME}" != "" ]; then | ||
python update_yaml.py '{"etlNginxImage":"'"${NGINX_IMAGE_NAME}:${TAG_NAME}"'","airflowImage":"'"${AIRFLOW_IMAGE_NAME}:${TAG_NAME}"'"}' apps/anyway/values-anyway-auto-updated.yaml &&\ | ||
git add apps/anyway/values-anyway-auto-updated.yaml && git commit -m "automatic update of prod etl anyway" | ||
else | ||
python update_yaml.py '{"etlNginxImageDev":"'"${NGINX_IMAGE_NAME}:${GITHUB_SHA}"'","airflowImageDev":"'"${AIRFLOW_IMAGE_NAME}:${GITHUB_SHA}"'"}' apps/anyway/values-anyway-auto-updated.yaml &&\ | ||
git add apps/anyway/values-anyway-auto-updated.yaml && git commit -m "automatic update of dev etl anyway" | ||
fi &&\ | ||
bin/update_anyway_env.py '{"etlNginxImage":"'"${NGINX_IMAGE_NAME}:${TAG_NAME}"'","airflowImage":"'"${AIRFLOW_IMAGE_NAME}:${TAG_NAME}"'"}' &&\ | ||
git add apps/anyway/.env && git commit -m "automatic update of prod etl anyway" | ||
&&\ | ||
git push origin main | ||
fi | ||
fi |