Skip to content

Commit

Permalink
WIP deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
tompahoward committed Oct 20, 2023
1 parent 4a6c74a commit 76793eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
TF_VAR_elastic_username: ${{ secrets.TF_VAR_elastic_username }}
TF_VAR_aws_secret_key: ${{ secrets.TF_VAR_aws_secret_key }}
TF_VAR_aws_access_key: ${{ secrets.TF_VAR_aws_access_key }}
TF_TOKEN: ${{ secrets.TERRAFORM_CLOUD_TOKEN }}
TERRAFORM_CLOUD_TOKEN: ${{ secrets.TERRAFORM_CLOUD_TOKEN }}
with:
runCmd: |
npm run deploy:test
Expand All @@ -70,4 +70,4 @@ jobs:
TF_VAR_elastic_username
TF_VAR_aws_secret_key
TF_VAR_aws_access_key
TF_TOKEN
TERRAFORM_CLOUD_TOKEN
6 changes: 5 additions & 1 deletion deploy/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ EOM

if test -z "$*"; then
TF_WORKSPACE="${npm_lifecycle_event#deploy:}"
terraform init -input=false
backend_config=""
if [[ -n "$TERRAFORM_CLOUD_TOKEN" ]]; then
backend_config="-backend-config=token=$TERRAFORM_CLOUD_TOKEN"
fi
terraform init -input=false $backend_config
# if we output a plan in the release PR, we can review it
# and apply it during the publish
{ terraform plan -refresh=true -input=false -detailed-exitcode; retVal="$?"; } || true
Expand Down

0 comments on commit 76793eb

Please sign in to comment.