Prepare one zuul docker job for all services

We want to have one flow for building Docker images of all Monasca
components. Every component should have `docker` folder and in this
folder file with name `build_image.sh` should be placed. By having one
global Zuul we could force this convention. Also this is good for
avoiding code duplication. Remove timeouts. They was unnecessary big.

Story: 2001694
Task: 28994
Change-Id: Iee7de1d8e873817a3b6f72e7ecc815bd8d6eb705
This commit is contained in:
Dobroslaw Zybort 2019-01-21 14:16:33 +01:00
parent 6f7f46cf0c
commit cb38433e4c
3 changed files with 31 additions and 3 deletions

View File

@ -37,9 +37,18 @@
- job:
name: docker-build-monasca-base
timeout: 10200
post-timeout: 3600
run: playbooks/run.yml
run: playbooks/docker_build_base.yml
required-projects:
- openstack/monasca-common
attempts: 1
irrelevant-files:
- ^.*\.rst$
- ^.*\.md$
- ^doc/.*$
- job:
name: docker-build-monasca-service
run: playbooks/docker_build_service.yml
required-projects:
- openstack/monasca-common
attempts: 1

View File

@ -0,0 +1,19 @@
---
- hosts: all
tasks:
- name: Run node setup script
shell: "{{ zuul.projects['git.openstack.org/openstack/monasca-common'].src_dir }}/playbooks/setup_ci.sh"
become: true
- name: Changing permission of Docker socket to 666
file:
path: /run/docker.sock
mode: 666
become: true
- name: Build Docker image
shell: "{{ zuul.project.src_dir }}/docker/build_image.sh {{ zuul.tag if zuul.pipeline == 'release' else zuul.branch | basename }}"
become: true
- name: List images
shell: "docker images --format '{% raw %}{{ .Repository }}:{{ .Tag }}{% endraw %}' | grep monasca"