From e4bf5b1c7c7834145fbc1233137ef74ea08aad96 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Tue, 21 Apr 2015 14:25:07 -0400 Subject: [PATCH] Add support for dependent changes Incorperate support for processing the ZUUL_CHANGES environment variable in the OpenStack CI system such that dependent or triggered changes for Ironic, Shade, or python-ironicclient are incorporated for testing. --- .../tasks/ironic_source_download.yaml | 22 ------------------- .../tasks/ironicclient_source_install.yml | 7 +++--- playbooks/roles/ironic-install/tasks/main.yml | 16 +++++++++----- .../tasks/shade_source_install.yml | 7 +++--- 4 files changed, 17 insertions(+), 35 deletions(-) delete mode 100644 playbooks/roles/ironic-install/tasks/ironic_source_download.yaml diff --git a/playbooks/roles/ironic-install/tasks/ironic_source_download.yaml b/playbooks/roles/ironic-install/tasks/ironic_source_download.yaml deleted file mode 100644 index 1133d2bf7..000000000 --- a/playbooks/roles/ironic-install/tasks/ironic_source_download.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. -- name: "Downloading Ironic" - command: git clone https://git.openstack.org/openstack/ironic chdir=/opt/stack creates=/opt/stack/ironic -- name: "Ironic - checking out master branch" - command: git checkout -f master chdir=/opt/stack/ironic -- name: "Ironic - resetting master branch" - command: git reset --hard master chdir=/opt/stack/ironic -- name: "Ironic - resyncing to current master branch" - command: git pull --ff-only chdir=/opt/stack/ironic/ diff --git a/playbooks/roles/ironic-install/tasks/ironicclient_source_install.yml b/playbooks/roles/ironic-install/tasks/ironicclient_source_install.yml index 2806c6deb..7faa77b03 100644 --- a/playbooks/roles/ironic-install/tasks/ironicclient_source_install.yml +++ b/playbooks/roles/ironic-install/tasks/ironicclient_source_install.yml @@ -15,15 +15,14 @@ --- - name: "python-ironicclient - Retrieving library from git.openstack.org" command: git clone https://review.openstack.org/openstack/python-ironicclient chdir=/opt/stack creates=/opt/stack/python-ironicclient - when: ci_testing == false - name: "python-ironicclient - Checking out master branch" command: git checkout -f master chdir=/opt/stack/python-ironicclient - when: ci_testing == false - name: "python-ironicclient - Resetting local repository" command: git reset --hard master chdir=/opt/stack/python-ironicclient - when: ci_testing == false - name: "python-ironicclient - Resyncing local repository" command: git pull --ff-only chdir=/opt/stack/python-ironicclient - when: ci_testing == false +- name: "python-ironicclient - Apply CI changes if necessary" + script: parse_zuul_changes.py /opt/stack/python-ironicclient https://review.openstack.org openstack/python-ironicclient "{{ lookup('env', 'ZUUL_CHANGES') }}" + when: ci_testing == true - name: "python-ironicclient - Installing patched python-ironicclient library." command: pip install -I --force-reinstall /opt/stack/python-ironicclient diff --git a/playbooks/roles/ironic-install/tasks/main.yml b/playbooks/roles/ironic-install/tasks/main.yml index 00ff0a6ad..e4f54e13c 100644 --- a/playbooks/roles/ironic-install/tasks/main.yml +++ b/playbooks/roles/ironic-install/tasks/main.yml @@ -34,11 +34,17 @@ - sgabios - name: "Ensuring /opt/stack is present" file: name=/opt/stack state=directory owner=root group=root -- name: "Install Ironic" - # NOTE(TheJulia): In the event of CI testing, we should expect the code to - # already be in place. - include: ironic_source_download.yaml - when: ci_testing == false +- name: "Downloading Ironic" + command: git clone https://git.openstack.org/openstack/ironic chdir=/opt/stack creates=/opt/stack/ironic +- name: "Ironic - checking out master branch" + command: git checkout -f master chdir=/opt/stack/ironic +- name: "Ironic - resetting master branch" + command: git reset --hard master chdir=/opt/stack/ironic +- name: "Ironic - resyncing to current master branch" + command: git pull --ff-only chdir=/opt/stack/ironic/ +- name: "Ironic - Apply CI changes if necessary" + script: parse_zuul_changes.py /opt/stack/ironic https://review.openstack.org openstack/ironic "{{ lookup('env', 'ZUUL_CHANGES') }}" + when: ci_testing == true - name: "Ironic Client - Install from source if configured to do so." include: ironicclient_source_install.yml when: skip_install is not defined and ((ironicclient_source_install is defined and ironicclient_source_install == true) or ci_testing == true) diff --git a/playbooks/roles/ironic-install/tasks/shade_source_install.yml b/playbooks/roles/ironic-install/tasks/shade_source_install.yml index 206b604e4..b76f89322 100644 --- a/playbooks/roles/ironic-install/tasks/shade_source_install.yml +++ b/playbooks/roles/ironic-install/tasks/shade_source_install.yml @@ -15,15 +15,14 @@ --- - name: "Shade - Retrieving library from git.openstack.org" command: git clone https://review.openstack.org/openstack-infra/shade chdir=/opt/stack creates=/opt/stack/shade - when: ci_testing == false - name: "Shade - Checking out master branch" command: git checkout -f master chdir=/opt/stack/shade - when: ci_testing == false - name: "Shade - Resetting local repository" command: git reset --hard master chdir=/opt/stack/shade - when: ci_testing == false - name: "Shade - Resyncing local repository" command: git pull --ff-only chdir=/opt/stack/shade - when: ci_testing == false +- name: "Shade - Apply CI changes if necessary" + script: parse_zuul_changes.py /opt/stack/shade https://review.openstack.org openstack-infra/shade "{{ lookup('env', 'ZUUL_CHANGES') }}" + when: ci_testing == true - name: "Shade - Installing patched shade library." command: pip install -I --force-reinstall /opt/stack/shade