Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
vmttn committed Aug 30, 2023
1 parent dc72fe9 commit 0eff7e8
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,26 +93,20 @@ jobs:
env:
ENCRYPTED_TF_OUTPUTS: ${{ needs.provision.outputs.encrypted_tf_outputs }}
TMP_ENCRYPTION_PASSWORD: ${{ secrets.TMP_ENCRYPTION_PASSWORD }}

run: |
TF_OUTPUTS=$(echo ${ENCRYPTED_TF_OUTPUTS} | base64 -d | gpg --batch --decrypt --passphrase "${TMP_ENCRYPTION_PASSWORD}")
python -c "$(cat << EOF
import json
import sys
TF_OUTPUTS = json.loads(sys.argv[-1])
AIRFLOW_CONN_S3=$(echo "${TF_OUTPUTS}" | jq '.airflow_conn_s3.value')
AIRFLOW_CONN_PG=$(echo "${TF_OUTPUTS}" | jq '.airflow_conn_pg.value')
SERVER_PUBLIC_IP=$(echo "${TF_OUTPUTS}" | jq '.public_ip.value')
airflow_conn_s3 = TF_OUTPUTS["airflow_conn_s3"]["value"]
airflow_conn_pg = TF_OUTPUTS["airflow_conn_pg"]["value"]
public_ip = TF_OUTPUTS["public_ip"]["value"]
echo "::add-mask::${AIRFLOW_CONN_S3}"
echo "::add-mask::${AIRFLOW_CONN_PG}"
print(f"::add-mask::{airflow_conn_s3}")
print(f"AIRFLOW_CONN_S3={airflow_conn_s3}")
print(f"::add-mask::{airflow_conn_pg}")
print(f"AIRFLOW_CONN_PG={airflow_conn_pg}")
print(f"SERVER_PUBLIC_IP={public_ip}")
EOF
)" "${TF_OUTPUTS}" >> "${GITHUB_OUTPUT}"
echo "airflow_conn_s3=${AIRFLOW_CONN_S3}" >> "${GITHUB_OUTPUT}"
echo "airflow_conn_pg=${AIRFLOW_CONN_PG}" >> "${GITHUB_OUTPUT}"
echo "server_public_ip=${SERVER_PUBLIC_IP}" >> "${GITHUB_OUTPUT}"
- name: set up ssh agent
env:
Expand Down

0 comments on commit 0eff7e8

Please sign in to comment.