Merge "Update ci-script to enable TripleO gate dependencies"
This commit is contained in:
commit
e9771041a8
@ -24,32 +24,62 @@ OVB_SETTINGS_FILE=$5
|
||||
OVB_CREDS_FILE=$6
|
||||
PLAYBOOK=$7
|
||||
JOB_TYPE=$8
|
||||
VIRTHOST=localhost
|
||||
|
||||
if [ "$JOB_TYPE" = "gate" ] || \
|
||||
[ "$JOB_TYPE" = "periodic" ] || \
|
||||
[ "$JOB_TYPE" = "dlrn-gate" ]; then
|
||||
unset REL_TYPE
|
||||
if [ "$RELEASE" = "master-tripleo-ci" ]; then
|
||||
# we don't have a local mirror for the tripleo-ci images
|
||||
unset CI_ENV
|
||||
fi
|
||||
elif [ "$JOB_TYPE" = "dlrn-gate-check" ]; then
|
||||
# setup a test patch to be built
|
||||
export ZUUL_HOST=review.openstack.org
|
||||
export ZUUL_CHANGES=openstack/tripleo-ui:master:refs/changes/25/422025/2
|
||||
unset REL_TYPE
|
||||
if [ "$RELEASE" = "master-tripleo-ci" ]; then
|
||||
# we don't have a local mirror for the tripleo-ci images
|
||||
unset CI_ENV
|
||||
fi
|
||||
elif [ "$JOB_TYPE" = "promote" ]; then
|
||||
export REL_TYPE=$LOCATION
|
||||
else
|
||||
echo "Job type must be one of the following:"
|
||||
echo " * gate - for gating changes on tripleo-quickstart or -extras"
|
||||
echo " * promote - for running promotion jobs"
|
||||
echo " * periodic - for running periodic jobs"
|
||||
echo " * dlrn-gate - for gating upstream changes"
|
||||
echo " * dlrn-gate-check - for gating upstream changes"
|
||||
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
|
||||
|
||||
# preparation steps to run with the gated roles
|
||||
if [ "$JOB_TYPE" = "gate" ]; then
|
||||
source $WORKSPACE/tripleo-quickstart/ci-scripts/include-gate-changes.sh
|
||||
|
||||
# we need to run differently (and twice) when gating upstream changes
|
||||
if [ "$JOB_TYPE" = "dlrn-gate" ] || [ "$JOB_TYPE" = "dlrn-gate-check" ]; then
|
||||
# TODO: Add dlrn-gate section in upcoming review
|
||||
|
||||
else
|
||||
bash quickstart.sh \
|
||||
--working-dir $WORKSPACE/ \
|
||||
--no-clone \
|
||||
--bootstrap \
|
||||
--playbook gate-quickstart.yml \
|
||||
--working-dir $WORKSPACE/ \
|
||||
--tags all \
|
||||
--no-clone \
|
||||
--config $WORKSPACE/$HW_ENV_DIR/network_configs/$NETWORK_ISOLATION/config_files/$CONFIG \
|
||||
--extra-vars @$OVB_SETTINGS_FILE \
|
||||
--extra-vars @$OVB_CREDS_FILE \
|
||||
--extra-vars @$WORKSPACE/$HW_ENV_DIR/network_configs/$NETWORK_ISOLATION/env_settings.yml \
|
||||
--playbook $PLAYBOOK \
|
||||
--release ${CI_ENV:+$CI_ENV/}$RELEASE${REL_TYPE:+-$REL_TYPE} \
|
||||
$OPT_ADDITIONAL_PARAMETERS \
|
||||
localhost
|
||||
$VIRTHOST
|
||||
fi
|
||||
|
||||
bash quickstart.sh \
|
||||
--bootstrap \
|
||||
--working-dir $WORKSPACE/ \
|
||||
--tags all \
|
||||
--no-clone \
|
||||
--config $WORKSPACE/$HW_ENV_DIR/network_configs/$NETWORK_ISOLATION/config_files/$CONFIG \
|
||||
--extra-vars @$OVB_SETTINGS_FILE \
|
||||
--extra-vars @$OVB_CREDS_FILE \
|
||||
--extra-vars @$WORKSPACE/$HW_ENV_DIR/network_configs/$NETWORK_ISOLATION/env_settings.yml \
|
||||
--playbook $PLAYBOOK \
|
||||
--release ${CI_ENV:+$CI_ENV/}$RELEASE${REL_TYPE:+-$REL_TYPE} \
|
||||
$OPT_ADDITIONAL_PARAMETERS \
|
||||
localhost
|
||||
|
@ -49,16 +49,7 @@ socketdir=$(mktemp -d /tmp/sockXXXXXX)
|
||||
export ANSIBLE_SSH_CONTROL_PATH=$socketdir/%%h-%%r
|
||||
|
||||
# preparation steps to run with the gated roles
|
||||
if [ "$JOB_TYPE" = "gate" ] || [ "$JOB_TYPE" = "dlrn-gate-check" ]; then
|
||||
bash quickstart.sh \
|
||||
--working-dir $WORKSPACE/ \
|
||||
--no-clone \
|
||||
--bootstrap \
|
||||
--playbook gate-quickstart.yml \
|
||||
--release ${CI_ENV:+$CI_ENV/}$RELEASE${REL_TYPE:+-$REL_TYPE} \
|
||||
$OPT_ADDITIONAL_PARAMETERS \
|
||||
$VIRTHOST
|
||||
fi
|
||||
source $WORKSPACE/tripleo-quickstart/ci-scripts/include-gate-changes.sh
|
||||
|
||||
# we need to run differently (and twice) when gating upstream changes
|
||||
if [ "$JOB_TYPE" = "dlrn-gate" ] || [ "$JOB_TYPE" = "dlrn-gate-check" ]; then
|
||||
|
25
ci-scripts/include-gate-changes.sh
Normal file
25
ci-scripts/include-gate-changes.sh
Normal file
@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
# CI script that includes gate changes and dependencies to be run in jobs.
|
||||
# This script should be run before a quickstart.sh run testing the change.
|
||||
# Usage: include-gate-change.sh <release> <job_type> <virthost>
|
||||
|
||||
# preparation steps to run with the gated roles
|
||||
if [ "$JOB_TYPE" = "gate" ] || [ "$JOB_TYPE" = "dlrn-gate-check" ]; then
|
||||
bash quickstart.sh \
|
||||
--working-dir $WORKSPACE/ \
|
||||
--no-clone \
|
||||
--bootstrap \
|
||||
--playbook gate-quickstart.yml \
|
||||
--release ${CI_ENV:+$CI_ENV/}$RELEASE${REL_TYPE:+-$REL_TYPE} \
|
||||
$OPT_ADDITIONAL_PARAMETERS \
|
||||
$VIRTHOST
|
||||
fi
|
||||
|
||||
# Rename tripleo-quickstart directory to include the gated change
|
||||
if [ -d $WORKSPACE/tripleo-quickstart-gate-repo ]; then
|
||||
mv $WORKSPACE/tripleo-quickstart $WORKSPACE/tripleo-quickstart-old;
|
||||
mv $WORKSPACE/tripleo-quickstart-gate-repo $WORKSPACE/tripleo-quickstart;
|
||||
cp $WORKSPACE/tripleo-quickstart-old/requirements* $WORKSPACE/tripleo-quickstart/;
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user