tripleo-ci/playbooks/tripleo-buildimage/run.yaml
Alex Schultz cf667ebfd8 Update heat agent path for image building
The heat-agent dib elements should be pulled from the heat-agents
repository and not the heat-templates repo. These agents have been
recently removed from the heat templates repo which has broken the image
building. https://review.openstack.org/#/c/584777/

Change-Id: I5bbf0b7b3c8c69d538f6ad07219a1bdd106a43b1
Closes-Bug: #1810431
2019-01-03 10:33:41 -07:00

115 lines
4.9 KiB
YAML

### DEPRECATED USE run-v3.yaml
- hosts: all
name: Autoconverted job legacy-tripleo-buildimage
roles:
- role: bindep
bindep_dir: "{{ ansible_user_dir }}/{{ zuul.projects['git.openstack.org/openstack/python-tripleoclient'].src_dir }}"
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-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
ELEMENTS="$WORKSPACE/tripleo-puppet-elements/elements:"
ELEMENTS+="$WORKSPACE/tripleo-image-elements/elements:"
ELEMENTS+="$WORKSPACE/heat-agents"
TOX_ENV=venv
# Basic Deployment (CLI)
# http://docs.openstack.org/developer/tripleo-docs/basic_deployment/basic_deployment_cli.html
case "$ZUUL_BRANCH" in
"stable/newton")
ELEMENTS+=":$WORKSPACE/instack-undercloud/elements"
DELOREAN_REPO_URL="https://trunk.rdoproject.org/centos7-newton/current"
DELOREAN_DEPS_URL="https://trunk.rdoproject.org/centos7-newton"
;;
"stable/ocata")
ELEMENTS+=":$WORKSPACE/instack-undercloud/elements"
DELOREAN_REPO_URL="https://trunk.rdoproject.org/centos7-ocata/current"
DELOREAN_DEPS_URL="https://trunk.rdoproject.org/centos7-ocata"
;;
"stable/pike")
ELEMENTS+=":$WORKSPACE/instack-undercloud/elements"
DELOREAN_REPO_URL="https://trunk.rdoproject.org/centos7-pike/current"
DELOREAN_DEPS_URL="https://trunk.rdoproject.org/centos7-pike"
;;
"stable/queens")
ELEMENTS+=":$WORKSPACE/instack-undercloud/elements"
DELOREAN_REPO_URL="https://trunk.rdoproject.org/centos7-queens/current"
DELOREAN_DEPS_URL="https://trunk.rdoproject.org/centos7-queens"
;;
"stable/rocky")
ELEMENTS+=":$WORKSPACE/instack-undercloud/elements"
DELOREAN_REPO_URL="https://trunk.rdoproject.org/centos7-rocky/current"
DELOREAN_DEPS_URL="https://trunk.rdoproject.org/centos7-rocky"
;;
*)
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*"
# install dib & tripleo-common source
tox -- pip install $WORKSPACE/diskimage-builder $WORKSPACE/tripleo-common
TRIPLEO_COMMON_PATH=$WORKSPACE/tripleo-common
export ELEMENTS_PATH=$ELEMENTS
if [ "{{ tripleo_image_type }}" == "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 -- openstack overcloud image build --type {{ tripleo_image_type }} --elements-path="$ELEMENTS"
else
tox -- openstack overcloud image build --image-name {{ tripleo_image_type }} $CONFIG_FILES
fi
mkdir -p $WORKSPACE/logs
mv *.log $WORKSPACE/logs
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'