Skip to content
Snippets Groups Projects
Commit f3552618 authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

Set build image name base on pipeline type

parent 26f4aa98
No related branches found
No related tags found
No related merge requests found
......@@ -81,10 +81,15 @@ build_image:
- 'sed -i -E "s/(lts_access_key: ).*/\1\"${AWS_ACCESS_KEY_ID}\"/" CRI_XCBC/group_vars/knightly'
- 'sed -i -E "s/(lts_secret_key: ).*/\1\"${AWS_SECRET_ACCESS_KEY}\"/" CRI_XCBC/group_vars/knightly'
- packer validate openstack-ood
- |
if [ $CI_PIPELINE_SOURCE == 'merge_request_event' ]; then
PKR_VAR_image_name="ood-PR-${CI_MERGE_REQUEST_ID}"
elif [ $CI_PIPELINE_SOURCE == 'schedule' ]; then
PKR_VAR_image_name="ood-${BUILD_DATE}"
fi
- >
PKR_VAR_build_instance_name="ood-${CRI_XCBC_HEAD}"
PKR_VAR_image_date_suffix=false
PKR_VAR_image_name="ood-${BUILD_DATE}"
packer build -machine-readable openstack-ood | tee ood_build.log
- export BUILT_OOD_IMAGE_ID=$(grep 'Image:' ood_build.log | awk '{print $4}')
- echo BUILT_OOD_IMAGE_ID=${BUILT_OOD_IMAGE_ID} | tee -a $CI_PROJECT_DIR/image.env
......
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