From f6bf7b97d53a5fdaad5a1792aedb30a8229efc22 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Wed, 16 Oct 2019 14:12:38 +0200 Subject: [PATCH] DIB: add --branch argument to override IPA branch Change-Id: I6954342e4c2d3936cdea415838849c31c84b77ac --- ironic_python_agent_builder/__init__.py | 6 ++++++ roles/ipa-build-dib-image/tasks/main.yaml | 6 ++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ironic_python_agent_builder/__init__.py b/ironic_python_agent_builder/__init__.py index 380b6e0..4d55a3b 100644 --- a/ironic_python_agent_builder/__init__.py +++ b/ironic_python_agent_builder/__init__.py @@ -47,6 +47,9 @@ def main(): default="ironic-python-agent") parser.add_argument("-e", "--element", action='append', default=[], help="Additional DIB element to use") + parser.add_argument("-b", "--branch", + help="If set, override the branch that is used for " + "ironic-python-agent and requirements") # TODO(dtantsur): handle distribution == tinyipa os.environ['ELEMENTS_PATH'] = find_elements_path() if not os.environ.get('DIB_INSTALLTYPE_pip_and_virtualenv'): @@ -57,6 +60,9 @@ def main(): args = parser.parse_args() if args.release: os.environ['DIB_RELEASE'] = args.release + if args.branch: + os.environ['DIB_REPOREF_ironic_python_agent'] = args.branch + os.environ['DIB_REPOREF_requirements'] = args.branch try: subprocess.check_call(['disk-image-create', '-o', args.output, 'ironic-python-agent-ramdisk', diff --git a/roles/ipa-build-dib-image/tasks/main.yaml b/roles/ipa-build-dib-image/tasks/main.yaml index 02222e5..96d0bb6 100644 --- a/roles/ipa-build-dib-image/tasks/main.yaml +++ b/roles/ipa-build-dib-image/tasks/main.yaml @@ -4,17 +4,15 @@ - name: Build a DIB image command: | - ironic-python-agent-builder -o {{ image_name }} + ironic-python-agent-builder -o {{ image_name }} -b HEAD {{ "-r {}".format(image_release) if image_release else '' }} {{ image_distro }} environment: # Increase from the default value of 30 DIB_DHCP_TIMEOUT: 60 - # Use repositories checked out by Zuul + # Use repositories checked out by Zuul (combined with -b HEAD above) DIB_REPOLOCATION_ironic_python_agent: '{{ ipa_source_path }}' - DIB_REPOREF_ironic_python_agent: HEAD DIB_REPOLOCATION_requirements: '{{ requirements_path }}' - DIB_REPOREF_requirements: HEAD - name: Move the resulting files shell: |