diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 18e0edb5b66b9ce028b9387915ed9a55436d7ffd..5a3722a4492967c3b844276e40dab87e28cf190c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -110,6 +110,30 @@ workflow: reports: dotenv: image.env +build_compute_image: + stage: build + needs: [build_base_image] + tags: + - build + script: + - *update_ansible_repo + - *get_ansible_files + - export PKR_VAR_source_image=${BUILT_BASE_IMAGE_ID} + - export REPO_HEAD=$(git rev-parse --short HEAD) + - export PKR_VAR_flavor="${COMPUTE_BUILD_FLAVOR:-$PKR_VAR_flavor}" + - export PKR_VAR_build_instance_name="compute-${REPO_HEAD}" + - export PKR_VAR_image_date_suffix=false + - | + if [ $CI_PIPELINE_SOURCE == 'merge_request_event' ]; then + export PKR_VAR_image_name="compute-PR-${CI_MERGE_REQUEST_IID}" + 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 + + build_http_proxy_image: stage: build environment: