aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Zhang <zhang.lei.fly@gmail.com>2017-11-15 13:18:55 +0800
committerJeffrey Zhang <jeffrey.zhang@99cloud.net>2017-11-28 04:45:30 +0000
commit9846a27a6b453d4591979653d7ac0d52f7930fc7 (patch)
treed3d4364dd85f19ec9bea0418b9a0048123749dbc
parent24f1714a164fb15b1764566d0bb531536ae024d5 (diff)
downloadkolla-9846a27a6b453d4591979653d7ac0d52f7930fc7.tar.gz
kolla-9846a27a6b453d4591979653d7ac0d52f7930fc7.zip
Improve gate post jobs
- Reuse build jobs to publish images - Add binary jobs in periodic pipeline - Push all image to dockerhub - Use branch name for image tag Change-Id: Ifefb96bcbcc9c6840cf865f7786b43a43fae4c17
-rw-r--r--.zuul.yaml64
-rw-r--r--tests/playbooks/publish.yml4
-rw-r--r--tests/templates/kolla-build.conf.j25
3 files changed, 38 insertions, 35 deletions
diff --git a/.zuul.yaml b/.zuul.yaml
index 418a0db7f..0755d0100 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -39,9 +39,36 @@
- kolla-build-oraclelinux-source
periodic:
jobs:
- - kolla-publish-ubuntu-source
- - kolla-publish-centos-source
- - kolla-publish-oraclelinux-source
+ - kolla-build-centos-source:
+ vars:
+ publisher: true
+ secrets:
+ - kolla_dockerhub_creds
+ - kolla-build-centos-binary:
+ vars:
+ publisher: true
+ secrets:
+ - kolla_dockerhub_creds
+ - kolla-build-ubuntu-source:
+ vars:
+ publisher: true
+ secrets:
+ - kolla_dockerhub_creds
+ - kolla-build-ubuntu-binary:
+ vars:
+ publisher: true
+ secrets:
+ - kolla_dockerhub_creds
+ - kolla-build-oraclelinux-source:
+ vars:
+ publisher: true
+ secrets:
+ - kolla_dockerhub_creds
+ - kolla-build-oraclelinux-binary:
+ vars:
+ publisher: true
+ secrets:
+ - kolla_dockerhub_creds
- secret:
name: kolla_dockerhub_creds
@@ -87,7 +114,9 @@
timeout: 10200
pre-run: tests/playbooks/pre.yml
run: tests/playbooks/run.yml
- post-run: tests/playbooks/post.yml
+ post-run:
+ - tests/playbooks/post.yml
+ - tests/playbooks/publish.yml
attempts: 1
required-projects:
- openstack/kolla-ansible
@@ -118,15 +147,6 @@
install_type: source
- job:
- name: kolla-publish-centos-source
- parent: kolla-build-centos-source
- post-run: tests/playbooks/publish.yml
- vars:
- publisher: true
- secrets:
- - kolla_dockerhub_creds
-
-- job:
name: kolla-build-ubuntu-binary
parent: kolla-base
nodeset: kolla-ubuntu
@@ -146,15 +166,6 @@
install_type: source
- job:
- name: kolla-publish-ubuntu-source
- parent: kolla-build-ubuntu-source
- post-run: tests/playbooks/publish.yml
- vars:
- publisher: true
- secrets:
- - kolla_dockerhub_creds
-
-- job:
name: kolla-build-oraclelinux-binary
parent: kolla-base
nodeset: kolla-centos
@@ -172,12 +183,3 @@
action: build
base_distro: oraclelinux
install_type: source
-
-- job:
- name: kolla-publish-oraclelinux-source
- parent: kolla-build-oraclelinux-source
- post-run: tests/playbooks/publish.yml
- vars:
- publisher: true
- secrets:
- - kolla_dockerhub_creds
diff --git a/tests/playbooks/publish.yml b/tests/playbooks/publish.yml
index 9a019fac9..a72dffc79 100644
--- a/tests/playbooks/publish.yml
+++ b/tests/playbooks/publish.yml
@@ -4,5 +4,9 @@
- name: Login to Dockerhub
command: "docker login -u {{ kolla_dockerhub_creds.user }} -p {{ kolla_dockerhub_creds.password }}"
no_log: true
+ when:
+ - publisher
- shell: "for img in $(docker images --format '{% raw %}{{ .Repository }}:{{ .Tag }}{% endraw %}' | grep kolla ); do docker push $img; done"
+ when:
+ - publisher
diff --git a/tests/templates/kolla-build.conf.j2 b/tests/templates/kolla-build.conf.j2
index 3b1ea1051..13e857178 100644
--- a/tests/templates/kolla-build.conf.j2
+++ b/tests/templates/kolla-build.conf.j2
@@ -1,11 +1,8 @@
[DEFAULT]
debug = true
{% if publisher %}
-profile = default
-profile = infra
-profile = main
namespace = kolla
-tag = queens
+tag = {{ zuul.branch | basename }}
{% endif %}
push = false
logs_dir = /tmp/logs/build