Skip to content
Snippets Groups Projects
Commit 594c0df5 authored by Krish Moodbidri's avatar Krish Moodbidri Committed by Bo-Chun Chen
Browse files

Add packer command to compute build

parent a5fdd6ac
No related branches found
No related tags found
2 merge requests!158Feat login build and deploy,!117This MR merges the feat-hpc-factory branch, which was focused on building and deploying proxy images for the COD cluster.
...@@ -118,7 +118,7 @@ build_compute_image: ...@@ -118,7 +118,7 @@ build_compute_image:
- *update_ansible_repo - *update_ansible_repo
- *get_ansible_files - *get_ansible_files
- export PKR_VAR_flavor="${COMPUTE_BUILD_FLAVOR:-$PKR_VAR_flavor}" - export PKR_VAR_flavor="${COMPUTE_BUILD_FLAVOR:-$PKR_VAR_flavor}"
- export PKR_VAR_build_instance_name="${BUILD_TARGET}-${COMPUTE_XCBC_HEAD}" - export PKR_VAR_build_instance_name="${BUILD_TARGET}-${CRI_XCBC_HEAD}"
- export PKR_VAR_image_date_suffix=false - export PKR_VAR_image_date_suffix=false
- | - |
if [ $CI_PIPELINE_SOURCE == 'merge_request_event' ]; then if [ $CI_PIPELINE_SOURCE == 'merge_request_event' ]; then
...@@ -126,7 +126,13 @@ build_compute_image: ...@@ -126,7 +126,13 @@ build_compute_image:
elif [ $CI_PIPELINE_SOURCE == 'schedule' ]; then elif [ $CI_PIPELINE_SOURCE == 'schedule' ]; then
export PKR_VAR_image_name="${BUILD_TARGET}-${BUILD_DATE}" export PKR_VAR_image_name="${BUILD_TARGET}-${BUILD_DATE}"
fi fi
# packer commands
- packer init openstack-compute
- packer validate openstack-compute
- packer build -machine-readable openstack-compute | tee compute_build.log
- export BUILT_COMPUTE_IMAGE_ID=$(grep 'Image:' compute_build.log | awk '{print $4}')
- echo BUILT_COMPUTE_IMAGE_ID=${BUILT_COMPUTE_IMAGE_ID} | tee -a $CI_PROJECT_DIR/image.env
- openstack image set --property CRI_XCBC_prod=${CRI_XCBC_prod} --property CRI_XCBC_dev=${CRI_XCBC_dev} --property PACKER_IMAGE_HEAD=${PACKER_IMAGE_HEAD} ${BUILT_COMPUTE_IMAGE_ID}
rules: rules:
- if: $PIPELINE_TARGET == "build" - if: $PIPELINE_TARGET == "build"
when: always when: always
......
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