tripleo-quickstart/ci-scripts/images.sh
Gael Chamoulaud 77e537f868 Add blank newline at the end of file
This patch adds blank newline for each [yaml|sh] files if they
don't end with one. This will allows us getting linters happy and avoid us
having git adding "\ No newline at end of file" in diffs when pushing
a new patch.

In other way, you can configure Git to properly handle line endings in
typing:

$ git config --global core.autocrlf input

Change-Id: I8a113541b3eae6a36ed32995822dedbbd2d9666e
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2017-03-27 10:40:32 +02:00

51 lines
1.7 KiB
Bash

#!/bin/bash
# CI test that builds images for both promote and gate jobs.
# For the promote jobs it publishes the image to the testing location.
# For the gate jobs it tests them with a full deploy.
# Usage: images.sh <release> <build_system> <config> <job_type>
set -eux
RELEASE=$1
BUILD_SYS=$2
CONFIG=$3
JOB_TYPE=$4
# These are set here to make it possible to locally reproduce the promote
# image building job in the same way as the other jobs.
PUBLISH=${PUBLISH:-"false"}
delorean_current_hash=${delorean_current_hash:-"consistent"}
REL_TYPE=${LOCATION:-"testing"}
if [ "$JOB_TYPE" = "gate" ] || [ "$JOB_TYPE" = "periodic" ]; then
PLAYBOOK='build-images-and-quickstart.yml'
delorean_current_hash='current-passed-ci'
elif [ "$JOB_TYPE" = "promote" ]; then
PLAYBOOK='build-images.yml'
else
echo "Job type must be one of gate, periodic, or promote"
exit 1
fi
# (trown) This is so that we ensure separate ssh sockets for
# concurrent jobs. Without this, two jobs running in parallel
# would try to use the same undercloud-stack socket.
socketdir=$(mktemp -d /tmp/sockXXXXXX)
export ANSIBLE_SSH_CONTROL_PATH=$socketdir/%%h-%%r
bash quickstart.sh \
--tags all \
--config $WORKSPACE/config/general_config/$CONFIG.yml \
--working-dir $WORKSPACE/ \
--playbook $PLAYBOOK \
--extra-vars undercloud_image_url="file:///var/lib/oooq-images/undercloud.qcow2" \
--extra-vars artib_release=$RELEASE \
--extra-vars artib_build_system=$BUILD_SYS \
--extra-vars artib_delorean_hash=$delorean_current_hash \
--extra-vars publish=$PUBLISH \
--extra-vars artib_image_stage_location="$REL_TYPE" \
--bootstrap \
--no-clone \
--release ${CI_ENV:+$CI_ENV/}$RELEASE \
$VIRTHOST