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

Merge branch 'feat_choose_image' into 'master'

Giving an option to use a predetermined image for xdmod

See merge request rc/terraform-openstack!10
parents 20e2344b d8ce441b
No related branches found
No related tags found
No related merge requests found
......@@ -46,10 +46,15 @@ tf-apply:
tags: [build]
script:
- export BUILD_DATE=$(TZ=America/Chicago date +%Y%m%d%H%M%S)
- XDMOD_IMAGES=($(openstack image list --sort-column Name --sort-descending -f value -c Name -c ID | grep -P ' xdmod-\d{14}$' | awk '{print $2}'))
- export TF_VAR_image_ohpc="${XDMOD_IMAGES[0]}"
# - export TF_VAR_image_ohpc="xdmod-20230629191611"
- echo $TF_VAR_image_ohpc
- |
if [ -z $TF_VAR_image_ohpc ];
then
XDMOD_IMAGES=($(openstack image list --sort-column Name --sort-descending -f value -c Name -c ID | grep -P ' xdmod-\d{14}$' | awk '{print $2}'))
export TF_VAR_image_ohpc="${XDMOD_IMAGES[0]}"
echo $TF_VAR_image_ohpc
else
echo "image_ohpc defined as ${TF_VAR_image_ohpc}"
fi
- export TF_VAR_keypair_name="os-gen-keypair-$BUILD_DATE"
- terraform apply -auto-approve || terraform destroy -auto-approve
......
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