[#33] Publish airshipctl image on Quay

This change introduces a job that publishes the latest airshipctl image
to quay.io/airshipit/airshipctl each time a new change is merged.

Closes #33

Change-Id: I8468b10a8064333d1749015960151e98adb2be97
Signed-off-by: Drew Walters <andrew.walters@att.com>
This commit is contained in:
Drew Walters 2020-02-12 15:52:52 -06:00
parent ea52398654
commit bcfcd6f9a0
6 changed files with 103 additions and 2 deletions

View File

@ -20,6 +20,7 @@ DOCKER_IMAGE_PREFIX ?= airshipit
DOCKER_IMAGE_TAG ?= dev
DOCKER_IMAGE ?= $(DOCKER_REGISTRY)/$(DOCKER_IMAGE_PREFIX)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)
DOCKER_TARGET_STAGE ?= release
PUBLISH ?= false
# go options
PKG ?= ./...
@ -111,6 +112,9 @@ else
--tag $(DOCKER_IMAGE) \
--target $(DOCKER_TARGET_STAGE)
endif
ifeq ($(PUBLISH), true)
@docker push $(DOCKER_IMAGE)
endif
.PHONY: print-docker-image-tag

View File

@ -0,0 +1,16 @@
# 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
#
# http://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: all
become: yes
roles:
- airshipctl-publish-images

View File

@ -0,0 +1,46 @@
# 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
#
# http://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.
- name: Install python-docker Module
apt:
pkg:
- python-docker
- python3-requests
state: present
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: List Docker Images
shell: docker image ls
- name: Push Images
block:
- name: Login to Image Registry
docker_login:
username: "{{ image-repo-credentials.username }}"
password: "{{ image-repo-credentials.password }}"
registry_url: "{{ image_repo }}"
- name: Push Image with Latest Tag
make:
chdir: "{{ zuul.project.src_dir }}"
params:
DOCKER_IMAGE_TAG: latest
PUBLISH: true
target: images
- name: Push Image with Commit Tag
make:
chdir: "{{ zuul.project.src_dir }}"
params:
DOCKER_IMAGE_TAG: "{{ zuul.newrev }}"
PUBLISH: true
target: images

View File

@ -28,8 +28,6 @@
name: airship-airshipctl-build-image
nodeset: airship-airshipctl-single-node
run: playbooks/airship-airshipctl-build-images.yaml
roles:
- zuul: openstack/openstack-helm-infra
irrelevant-files:
- ^.*\.md$
- ^docs/.*$
@ -86,3 +84,13 @@
vars:
rtd_project_name: airship-airshipctl
rtd_webhook_id: 112688
- job:
name: airship-airshipctl-publish-image
parent: airship-airshipctl-build-image
post-run: playbooks/airship-airshipctl-publish-images.yaml
secrets:
- airshipctl-image-repo-credentials
vars:
image: quay.io/airshipit/airshipctl
image_repo: https://quay.io/api/v1/

View File

@ -28,4 +28,5 @@
post:
jobs:
- airship-airshipctl-publish-docs
- airship-airshipctl-publish-image
- airship-airshipctl-upload-git-mirror

View File

@ -57,3 +57,29 @@
B4PhXVzb3mTLrFcakuP4U7g7UkAbqg4CHJKuF2BiazJRZH569YFJdP0UkOXz8tSTRDTQh
uPzQ1Ero9vGyHmFuvFczZK+TnJBxyKiyWr4kR9GbI3WVXMSa78M+kRqQmcnqdwS9AAFC2
595F3m2UtgR6QKN5xbJJmWp7ipihdRvQ1eVl5GCjG7MBi27YvILp4cIWg+MO1I=
- secret:
name: airshipctl-image-repo-credentials
data:
username: !encrypted/pkcs1-oaep
- IrKFuv6QJnGT7C/c6a4GCmDLJn0rZ82ivaAd3BjP3QyTegM95gVCOFC4l45NGRLLtzFun
43XI00cNxokj4qohxzxstjq/3SIyHZ4EKmQD+Ln/YWGk39S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