Skip to content

Commit

Permalink
Update ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
OriHoch authored Jan 25, 2024
1 parent e4efdf7 commit 8e3ee4a
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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\//}"
Expand Down Expand Up @@ -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

0 comments on commit 8e3ee4a

Please sign in to comment.