Monty Taylor 1075bbd082
Add workspace directory for converted legacy jobs
This isn't really a thing in v3, but structurally it's a thing we
need to provide to v2 jobs so they don't get confused.

Change-Id: Icb528444f44f18ca29e02154513b9facefd04c89
2017-09-27 08:14:22 -05:00

111 lines
4.5 KiB
YAML

- hosts: all
name: Autoconverted job legacy-tripleo-buildimage-overcloud-hardened-full-centos-7
from old job gate-tripleo-buildimage-overcloud-hardened-full-centos-7-nv
tasks:
- name: Ensure legacy workspace directory
file:
path: '{{ ansible_user_dir }}/workspace'
state: directory
- shell:
cmd: |
set -e
set -x
CLONEMAP=`mktemp`
function cleanup {
rm -f $CLONEMAP
}
trap cleanup EXIT
cat > $CLONEMAP << EOF
clonemap:
- name: 'openstack/(.*)'
dest: '\1'
EOF
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP \
--cache-dir /opt/git \
git://git.openstack.org \
openstack/diskimage-builder \
openstack/heat-templates \
openstack/heat-agents \
openstack/instack-undercloud \
openstack/python-tripleoclient \
openstack/tripleo-common \
openstack/tripleo-image-elements \
openstack/tripleo-puppet-elements \
openstack/requirements
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
cd python-tripleoclient
/usr/local/jenkins/slave_scripts/install-distro-packages.sh
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
cd python-tripleoclient
ELEMENTS="$WORKSPACE/instack-undercloud/elements:"
ELEMENTS+="$WORKSPACE/tripleo-puppet-elements/elements:"
ELEMENTS+="$WORKSPACE/tripleo-image-elements/elements:"
ELEMENTS+="$WORKSPACE/heat-templates/hot/software-config/elements"
# Basic Deployment (CLI)
# http://docs.openstack.org/developer/tripleo-docs/basic_deployment/basic_deployment_cli.html
case "$ZUUL_BRANCH" in
"stable/newton")
DELOREAN_REPO_URL="https://trunk.rdoproject.org/centos7-newton/current"
DELOREAN_DEPS_URL="https://trunk.rdoproject.org/centos7-newton"
;;
"stable/ocata")
DELOREAN_REPO_URL="https://trunk.rdoproject.org/centos7-ocata/current"
DELOREAN_DEPS_URL="https://trunk.rdoproject.org/centos7-ocata"
;;
*)
DELOREAN_REPO_URL="https://trunk.rdoproject.org/centos7-master/current-tripleo"
DELOREAN_DEPS_URL="https://trunk.rdoproject.org/centos7"
;;
esac
# setup the repos
sudo yum clean metadata
sudo curl -L ${DELOREAN_DEPS_URL}/delorean-deps.repo -o /etc/yum.repos.d/delorean-deps.repo
sudo curl -L ${DELOREAN_REPO_URL}/delorean.repo -o /etc/yum.repos.d/delorean.repo
export DIB_YUM_REPO_CONF="/etc/yum.repos.d/delorean*"
# if we are on master, install from source
# otherwise, install from requirements
if [ "$ZUUL_BRANCH" == "master" ]; then
tox -evenv -- pip install $WORKSPACE/diskimage-builder
else
export UPPER_CONSTRAINTS_FILE=$WORKSPACE/requirements/upper-constraints.txt
tox -evenv -- pip install diskimage-builder -c $UPPER_CONSTRAINTS_FILE
fi
TRIPLEO_COMMON_PATH=$WORKSPACE/tripleo-common
export ELEMENTS_PATH=$ELEMENTS
if [ "overcloud-hardened-full" == "overcloud-hardened-full" ]; then
CONFIG_FILES="--config-file $TRIPLEO_COMMON_PATH/image-yaml/overcloud-hardened-images.yaml --config-file $TRIPLEO_COMMON_PATH/image-yaml/overcloud-hardened-images-centos7.yaml"
else
CONFIG_FILES="--config-file $TRIPLEO_COMMON_PATH/image-yaml/overcloud-images.yaml --config-file $TRIPLEO_COMMON_PATH/image-yaml/overcloud-images-centos7.yaml"
fi
if [ "$ZUUL_BRANCH" == "stable/newton" ]; then
tox -evenv -- openstack overcloud image build --type overcloud-hardened-full --elements-path="$ELEMENTS"
else
tox -evenv -- openstack overcloud image build --image-name overcloud-hardened-full $CONFIG_FILES
fi
mkdir -p $WORKSPACE/logs
mv *.log $WORKSPACE/logs
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'