Skip to content
Snippets Groups Projects
Commit 886c4f05 authored by Ravi Tripathi's avatar Ravi Tripathi
Browse files

Merge branch 'feat-env-specific-vars' into 'master'

Add environemnt specific variables

See merge request rc/terraform-openstack!13
parents da0ef77d 906c7012
No related merge requests found
......@@ -26,6 +26,30 @@ stages: # List of stages for jobs, and their order of execution
- deploy
- cleanup
prep-deploy:
stage: .pre
tags: [build]
script:
- |
if [ "$TARGET_ENV" = "dev" ]; then
TF_VAR_data_volume="xdmod-dev-volume"
TF_VAR_flavor="m1.medium"
elif [ "$TARGET_ENV" = "staging" ]; then
TF_VAR_data_volume="xdmod-staging-volume"
TF_VAR_flavor="m1.medium"
elif [ "$TARGET_ENV" = "production" ]; then
TF_VAR_data_volume="xdmod-staging-volume"
TF_VAR_flavor="m1.xlarge"
else
echo "Unknown TARGET_ENV: $TARGET_ENV"
exit 1
fi
echo "TF_VAR_data_volume=${TF_VAR_data_volume}" | tee -a $CI_PROJECT_DIR/vars.env
echo "TF_VAR_flavor=${TF_VAR_flavor}" | tee -a $CI_PROJECT_DIR/vars.env
artifacts:
reports:
dotenv: vars.env
tf-validate:
stage: validate
tags: [build]
......@@ -45,6 +69,8 @@ tf-apply:
stage: build
tags: [build]
script:
- echo "TF_VAR_data_volume=${TF_VAR_data_volume}"
- echo "TF_VAR_flavor=${TF_VAR_flavor}"
- export BUILD_DATE=$(TZ=America/Chicago date +%Y%m%d%H%M%S)
- export TF_VAR_internal_network="xdmod-packer-clusternet-$BUILD_DATE"
- |
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment