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

Init packer before building image

parent 9688b22b
No related branches found
No related tags found
No related merge requests found
......@@ -120,6 +120,7 @@ build_base_image:
elif [ $CI_PIPELINE_SOURCE == 'schedule' ]; then
export PKR_VAR_image_name="base-${BUILD_DATE}"
fi
- packer init openstack
- packer validate openstack
- packer build -machine-readable openstack | tee base_build.log
- export BUILT_BASE_IMAGE_ID=$(grep 'Image:' base_build.log | awk '{print $4}')
......@@ -149,6 +150,7 @@ build_compute_image:
elif [ $CI_PIPELINE_SOURCE == 'schedule' ]; then
export PKR_VAR_image_name="compute-${BUILD_DATE}"
fi
- packer init openstack-compute
- packer validate openstack-compute
- packer build -machine-readable openstack-compute | tee compute_build.log
......@@ -175,6 +177,7 @@ build_gpu_image:
elif [ $CI_PIPELINE_SOURCE == 'schedule' ]; then
export PKR_VAR_image_name="gpu-${BUILD_DATE}"
fi
- packer init openstack-gpu
- packer validate openstack-gpu
- openstack server delete --wait $GPU_PLACEHOLDER_NAME
- packer build -machine-readable openstack-gpu | tee gpu_build.log || FAILED=true
......@@ -206,6 +209,7 @@ build_ood_image:
- 'sed -i -E "s/(user_register_app_key: ).*/\1\"${SELF_REG_APP_KEY}\"/" CRI_XCBC/group_vars/knightly'
- 'sed -i -E "s/(celery_user_password: ).*/\1\"${CELERY_PASSWD}\"/" CRI_XCBC/group_vars/knightly'
- 'sed -i -E "s|(ssh_pub_key: ).*|\1\"{{ lookup(''file'', ''${SSH_PUB_KEY}'') }}\"|" CRI_XCBC/group_vars/knightly'
- packer init openstack-ood
- packer validate openstack-ood
- |
if [ $CI_PIPELINE_SOURCE == 'merge_request_event' ]; then
......
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