c1327819bb
https://review.openstack.org/#/c/607288/ shuffled some basic setup tasks around and put them in tripleo-ci/pre.yaml. Unfortunately the configure-swap task isn't idempotent so let's stop duplicating the tasks in the build jobs now. Change-Id: I046aeea86b3b63cae0b44865dc8ee0a59a3f7f5f Closes-Bug: #1810777
66 lines
2.5 KiB
YAML
66 lines
2.5 KiB
YAML
- hosts: all
|
|
name: TripleO image building job
|
|
roles:
|
|
- role: bindep
|
|
bindep_dir: "{{ ansible_user_dir }}/{{ zuul.projects['git.openstack.org/openstack/python-tripleoclient'].src_dir }}"
|
|
- role: tripleo-repos
|
|
tripleo_repos_repository: "{{ ansible_user_dir }}/{{ zuul.projects['git.openstack.org/openstack/tripleo-repos'].src_dir }}"
|
|
tasks:
|
|
- name: Include common buildimage vars
|
|
include_vars:
|
|
file: "common.yaml"
|
|
|
|
- name: Install pip
|
|
package:
|
|
name: python-pip
|
|
state: present
|
|
|
|
- name: Install virtualenv
|
|
package:
|
|
name: python-virtualenv
|
|
state: present
|
|
|
|
- name: pip install tripleo items
|
|
become: true
|
|
pip:
|
|
name:
|
|
- "file://{{ openstack_git_root }}/diskimage-builder"
|
|
- "file://{{ openstack_git_root }}/python-tripleoclient"
|
|
- "file://{{ openstack_git_root }}/tripleo-common"
|
|
state: present
|
|
virtualenv: "{{ workspace }}/venv"
|
|
|
|
# NOTE(aschultz) :we dropped support for instack-undercloud in Stein so
|
|
# we use a directory existance check to determine if we should include it
|
|
- name: Run image build
|
|
args:
|
|
chdir: '{{ workspace }}'
|
|
shell: |
|
|
set -x
|
|
source {{ workspace }}/venv/bin/activate
|
|
TRIPLEO_COMMON_PATH="{{ openstack_git_root }}/tripleo-common"
|
|
|
|
ELEMENTS="{{ openstack_git_root }}/tripleo-puppet-elements/elements:"
|
|
ELEMENTS+="{{ openstack_git_root }}/tripleo-image-elements/elements:"
|
|
ELEMENTS+="{{ openstack_git_root }}/heat-agents"
|
|
|
|
if [ -d "{{ openstack_git_root }}/instack-undercloud/elements" ]; then
|
|
ELEMENTS="{{ openstack_git_root }}/instack-undercloud/elements:${ELEMENTS}"
|
|
fi
|
|
|
|
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-{{ tripleo_image_os }}.yaml"
|
|
else
|
|
CONFIG_FILES="--config-file $TRIPLEO_COMMON_PATH/image-yaml/overcloud-images.yaml --config-file $TRIPLEO_COMMON_PATH/image-yaml/overcloud-images-{{ tripleo_image_os }}.yaml"
|
|
fi
|
|
|
|
export ELEMENTS_PATH=$ELEMENTS
|
|
export DIB_YUM_REPO_CONF="/etc/yum.repos.d/delorean*"
|
|
|
|
openstack overcloud image build --image-name {{ tripleo_image_type }} $CONFIG_FILES > {{ workspace }}/build.log 2> {{ workspace }}/build-err.log
|
|
RESULT=$?
|
|
|
|
mv *.log {{ workspace }}/logs/
|
|
exit $RESULT
|
|
|