@@ -138,6 +138,7 @@ jobs:
138138 - name : Configure AWS Namespace
139139 env :
140140 PR_NUMBER : ${{ github.event.number }}
141+ # This is the branch name, or the git tag name
141142 NS_BRANCH_OR_TAG : ${{ github.ref_name }}
142143 run : |
143144 echo "PR_NUMBER=${{ env.PR_NUMBER }}"
@@ -160,6 +161,8 @@ jobs:
160161 test $(shasum -a 256 ./dce_linux_amd64.zip | awk '{print $1}') == "${expected_sha}"
161162 unzip ./dce_linux_amd64.zip -d ./
162163
164+ # Lease a DCE account, to use for deploying our PR environment
165+ # (deploy DCE in DCE)
163166 - name : Lease DCE Account
164167 env :
165168 AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
@@ -176,7 +179,8 @@ jobs:
176179 basepath: /api
177180 region: us-east-1
178181 " > ./dce.yml
179-
182+
183+ # Check to see if there's an active lease for this PR
180184 lease_id=$(
181185 ./dce --config=dce.yml leases list \
182186 -p ${NAMESPACE} -s Active | \
@@ -197,16 +201,18 @@ jobs:
197201 ./dce --config=dce.yml leases login ${lease_id}
198202 echo "${lease_id}" > ./lease_id.txt
199203
204+ # Install Terraform
200205 - name : Install Terraform
201206 uses : hashicorp/setup-terraform@v2
202207 with :
203208 terraform_version : ${{ inputs.terraform_version }}
204209
210+ # Configure the Terraform backend
205211 - name : Configure Terraform Backend
206212 run : |
207213 lease_id=$(cat lease_id.txt)
208214 ./scripts/create-tf-backend.sh ${lease_id}
209-
215+ # terraform init
210216 - name : Terraform Init/Apply
211217 env :
212218 NAMESPACE : ${{ env.namespace }}
@@ -391,7 +397,8 @@ jobs:
391397 cp ${{ github.workspace }}/backend-tf/backend.tf ./modules/
392398 chmod +x ./dce
393399
394- - name : Install Terraform for Cleanup
400+ # Cleanup the PR environment
401+ - name : Terraform for Cleanup
395402 uses : hashicorp/setup-terraform@v2
396403 with :
397404 terraform_version : ${{ inputs.terraform_version }}
@@ -411,7 +418,8 @@ jobs:
411418 cd modules
412419 terraform init -input=false
413420 terraform destroy -auto-approve
414-
421+
422+ # End the DCE lease
415423 - name : End DCE Lease
416424 env :
417425 AWS_DEFAULT_REGION : us-east-1
0 commit comments