Last active
December 11, 2021 08:19
-
-
Save FATESAIKOU/26e6565b0f1db1684cb1e092ffb16fef to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| deploy-to-aws: | |
| ...略 | |
| - steps: | |
| ...略 | |
| - name: Deploy crawler with terraform | |
| run: |- | |
| cd section_18/crawler/env | |
| terraform init | |
| terraform plan -out dev.tfplan | |
| terraform apply dev.tfplan || touch build_failed.txt | |
| if [ -f "build_failed.txt" ] | |
| then | |
| terraform plan -destroy -out destroy.tfplan && terraform apply destroy.tfplan | |
| exit 1 | |
| fi | |
| terraform output -json | grep -v '::' | grep -v 'command' | jq -r 'keys[] as $k | "\($k)=\(.[$k].value)"' > ../../reader/.env | |
| env: | |
| TF_VAR_aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| TF_VAR_aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| TF_VAR_db_username: ${{ secrets.DB_USER }} | |
| TF_VAR_db_password: ${{ secrets.DB_PASS }} | |
| TF_VAR_db_sql_path: ../init.sql | |
| TF_VAR_proxy_user: ${{ secrets.PROXY_USER }} | |
| TF_VAR_proxy_host: ${{ secrets.PROXY_HOST }} | |
| TF_VAR_proxy_port: ${{ secrets.PROXY_PORT }} | |
| TF_VAR_proxy_pem: proxy.pem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment