diff --git a/.zuul.yaml b/.zuul.yaml index 26497b8..eb9f901 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: