summaryrefslogtreecommitdiff
path: root/contrib/cirrus/build_vm_images.sh
diff options
context:
space:
mode:
authorChris Evich <cevich@redhat.com>2018-11-07 09:12:15 -0500
committerChris Evich <cevich@redhat.com>2018-12-06 15:39:18 -0500
commit8d7fdc7d79e4de3e3ff5bb50e157d49a0bf8971e (patch)
tree801185e293def2f3437fedb5313d53c7ff448e5b /contrib/cirrus/build_vm_images.sh
parentfb3ceeb385b11efa7952c87698add01bdff01c54 (diff)
downloadpodman-8d7fdc7d79e4de3e3ff5bb50e157d49a0bf8971e.tar.gz
podman-8d7fdc7d79e4de3e3ff5bb50e157d49a0bf8971e.tar.bz2
podman-8d7fdc7d79e4de3e3ff5bb50e157d49a0bf8971e.zip
Cirrus: Use Makefile for image-building
The packer tool takes JSON as input for the details of producing VM images to be used for PR CI-testing. JSON is not a very human-friendly format, without support for comments and frequently containing lots of duplicate data. Fix this by using a Makefile + simple python one-liner to convert from a human-friendly YAML format into packer-native JSON. This allows use of anchors/aliases to reduce duplication, and allows inline comments for easier maintainability. This also allows separating the 'test' action from the 'build' action, for earlier and better syntax problem detection. Lastly, there are some minor ``lib.sh`` and ``integration_test.sh`` updates to support future work, and slightly improve the build and test environments. Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'contrib/cirrus/build_vm_images.sh')
-rwxr-xr-xcontrib/cirrus/build_vm_images.sh19
1 files changed, 8 insertions, 11 deletions
diff --git a/contrib/cirrus/build_vm_images.sh b/contrib/cirrus/build_vm_images.sh
index c8ff55445..818097e2c 100755
--- a/contrib/cirrus/build_vm_images.sh
+++ b/contrib/cirrus/build_vm_images.sh
@@ -11,9 +11,9 @@ PACKER_BUILDS $PACKER_BUILDS
CENTOS_BASE_IMAGE $CENTOS_BASE_IMAGE
UBUNTU_BASE_IMAGE $UBUNTU_BASE_IMAGE
FEDORA_BASE_IMAGE $FEDORA_BASE_IMAGE
+FAH_BASE_IMAGE $FAH_BASE_IMAGE
RHEL_BASE_IMAGE $RHEL_BASE_IMAGE
RHSM_COMMAND $RHSM_COMMAND
-BUILT_IMAGE_SUFFIX $BUILT_IMAGE_SUFFIX
SERVICE_ACCOUNT $SERVICE_ACCOUNT
GCE_SSH_USERNAME $GCE_SSH_USERNAME
GCP_PROJECT_ID $GCP_PROJECT_ID
@@ -43,13 +43,10 @@ fi
set -x
-cd "$GOSRC"
-# N/B: /usr/sbin/packer is a DIFFERENT tool, and will exit 0 given the args below :(
-TEMPLATE="./$PACKER_BASE/libpod_images.json"
-
-$HOME/packer/packer inspect "$TEMPLATE"
-
-#$HOME/packer/packer build -machine-readable "-only=$PACKER_BUILDS" "$TEMPLATE" | tee /tmp/packer_log.csv
-$HOME/packer/packer build "-only=$PACKER_BUILDS" "$TEMPLATE"
-
-# TODO: Report back to PR names of built images
+cd "$GOSRC/$PACKER_BASE"
+make libpod_images \
+ PACKER_BUILDS=$PACKER_BUILDS \
+ PACKER_VER=$PACKER_VER \
+ GOSRC=$GOSRC \
+ SCRIPT_BASE=$SCRIPT_BASE \
+ PACKER_BASE=$PACKER_BASE