Skip to content
Snippets Groups Projects

wip: test-keypair without file

Closed Krish Moodbidri requested to merge feat-test-keypair into feat-deploy-xdmod-supremm
Compare and Show latest version
2 files
+ 25
22
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 24
21
@@ -7,40 +7,43 @@ variables:
OS_IDENTITY_API_VERSION: "3"
OS_AUTH_TYPE: "v3applicationcredential"
OS_AUTH_URL: "https://keystone.cloud.rc.uab.edu:5000/v3"
TF_ROOT: ${CI_PROJECT_DIR}/
TF_VAR_internal_network: "tf-clusternet"
TF_VAR_external_network: "tf-dmznet"
cache:
paths:
- .terraform
- .terraform.lock.hcl
- terraform.tfstate
stages: # List of stages for jobs, and their order of execution
- validate
- build
- test
- deploy
- cleanup
build_packer:
stage: build
tf-validate:
stage: validate
tags: [build]
script:
- terraform --version
- terraform init
- terraform apply --auto-approve
unit-test-job: # This job runs in the test stage.
stage: test # It only starts when the job in the build stage completes successfully.
script:
- echo "Running unit tests... This will take about 60 seconds."
- sleep 60
- echo "Code coverage is 90%"
- terraform validate
- terraform plan
lint-test-job: # This job also runs in the test stage.
stage: test # It can run at the same time as unit-test-job (in parallel).
tf-apply:
stage: build
tags: [build]
script:
- echo "Linting code... This will take about 10 seconds."
- sleep 10
- echo "No lint issues found."
- export BUILD_DATE=$(TZ=America/Chicago date +%Y%m%d)
- export TF_VAR_internal_network="tf-clusternet-$BUILD_DATE"
- export TF_VAR_external_network="tf-dmznet-$BUILD_DATE"
- terraform apply -auto-approve
deploy-job: # This job runs in the deploy stage.
stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
environment: production
clean-up:
stage: cleanup
tags: [build]
script:
- echo "Deploying application..."
- echo "Application successfully deployed."
- terraform destroy -auto-approve
when: manual
Loading