From eadd4a2a5ffb3d391ab7ee205e543f85295e7dab Mon Sep 17 00:00:00 2001 From: Matt McEuen Date: Mon, 16 Mar 2020 12:39:37 -0500 Subject: [PATCH] Fix image build This does the following: - Adds a (non-publishing) image build job as a check - Fixes the image build via pip installing docker - relabels some airshipctl things to images Change-Id: I4f722d81b7c5fbcea5f76350682687d39b2c55a6 --- .zuul.yaml | 12 +++++- playbooks/airship-images-build.yaml | 37 +++++++++++++++++++ ...yaml => airship-images-deploy-docker.yaml} | 0 playbooks/airship-images-publish.yaml | 3 ++ 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 playbooks/airship-images-build.yaml rename playbooks/{airship-airshipctl-deploy-docker.yaml => airship-images-deploy-docker.yaml} (100%) diff --git a/.zuul.yaml b/.zuul.yaml index 9de4cc6..b8e5de1 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -14,9 +14,11 @@ check: jobs: - airship-images-functional + - airship-images-build gate: jobs: - airship-images-functional + - airship-images-build post: jobs: - images-upload-git-mirror @@ -24,7 +26,7 @@ - job: name: airship-images-functional - pre-run: playbooks/airship-airshipctl-deploy-docker.yaml + pre-run: playbooks/airship-images-deploy-docker.yaml run: playbooks/airship-images-test.yaml nodeset: airship-images-single-node @@ -39,12 +41,18 @@ secret: images-airshipit-github-secret pass-to-parent: true +- job: + name: airship-images-build + nodeset: airship-images-single-node + pre-run: playbooks/airship-images-deploy-docker.yaml + run: playbooks/airship-images-build.yaml + - job: name: airship-images-publish nodeset: airship-images-single-node timeout: 1800 post-timeout: 1800 - pre-run: playbooks/airship-airshipctl-deploy-docker.yaml + pre-run: playbooks/airship-images-deploy-docker.yaml run: playbooks/airship-images-publish.yaml secrets: - name: airship_images_quay_creds diff --git a/playbooks/airship-images-build.yaml b/playbooks/airship-images-build.yaml new file mode 100644 index 0000000..76e6110 --- /dev/null +++ b/playbooks/airship-images-build.yaml @@ -0,0 +1,37 @@ +# Copyright 2019 AT&T Intellectual Property. All other rights reserved. +# +# 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 +# +# https://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. +# + +- hosts: primary + tasks: + - name: Install python-docker module + apt: + pkg: + - python-docker + - python3-requests + state: present + become: true + when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' + - name: Install docker pip module + pip: + name: docker + - name: Publish images + block: + - make: + chdir: "{{ zuul.project.src_dir }}" + target: "images" + params: + COMMIT: "{{ zuul.newrev | default('') }}" + PUSH_IMAGE: "false" + become: True diff --git a/playbooks/airship-airshipctl-deploy-docker.yaml b/playbooks/airship-images-deploy-docker.yaml similarity index 100% rename from playbooks/airship-airshipctl-deploy-docker.yaml rename to playbooks/airship-images-deploy-docker.yaml diff --git a/playbooks/airship-images-publish.yaml b/playbooks/airship-images-publish.yaml index 1158fa4..9f737b2 100644 --- a/playbooks/airship-images-publish.yaml +++ b/playbooks/airship-images-publish.yaml @@ -23,6 +23,9 @@ state: present become: true when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' + - name: Install docker pip module + pip: + name: docker - name: Publish images block: - docker_login: