Remove all docker image building jobs

These will be re-added in followup changes based on the new
zuul-jobs roles.

Change-Id: I0c0691afb180903c573cc1a9eb39590fa58e7ca6
This commit is contained in:
James E. Blair 2019-01-15 14:08:00 -08:00
parent b1c4a6d36a
commit 9e6a4d327e
14 changed files with 0 additions and 727 deletions

View File

@ -22,263 +22,6 @@
vars:
project_src_dir: "{{ zuul.project.src_dir }}/modules/openstack_project"
# Image building jobs
- secret:
name: system-config-dockerhub
data:
username: openstackzuul
password: !encrypted/pkcs1-oaep
- iz3aVtc1eXwM/d02gaA8qyvryJtrOOTmPZhfWiRw3VaVpuU/lrpSD/qRKPwBEbhFCpzCh
B3eelTaJMKaMsVFU/cD+EOB6MBpCtHreKug3+B1g1Ag9TQaLGfa2d7swPRrhFEENpQBzm
D9OqBYVCWTyGo/Y1nkC/zb+e1H2IdI1axNJrVaKR6FYN8vhpPsflvyW2PCNsdT2YlKCMz
G0wFMJv6zMH6Jw1c0ruHm5pa9O4EWLwhmdxHMeTRAT4JVJdLehVGQLBXvXxZzMOXB2Jrj
KHIMFFhzlc1bZXcFKAMakvfP0ARLmPySEnIcVHjHXvsXmGLuVB0lSXUtUB1QW8qJcso1m
C0ky4VAFHoNB/EV5VGu7btkZDtJKzsQcPXnaT1LcX1xS+QC0bC4SYR25WN9RK7z1sXvMn
dxMIwJIvXOb+aE5mdl63G8OBTxznPAGioCZNjqoMPQJ7VzITSYnPiW5CyZDUinTSDDver
zHBG/Svpwiu7Lm2vOgExHYdCDeo0a5lacxjcwW2FfP7fal3ZLoTeSTGXvIaffS552mZ9L
I0cLfq/ikkbaC4a+bqFnVdDm9wNAyBtOkq5wn3TqOFMrFaBlkI5/34i2fLauZOoka6bcN
zJnvDrjRemvgmWP1q4uI8cPzJK3zjN9/GYrs1MQxHCsNn33sWpc1oHRO+TL/8g=
- job:
name: system-config-build-image
description: |
Build a docker image.
.. zuul:jobvar:: images
A list of images to build. Each item in the list should have:
.. zuul:jobvar:: context
The docker build context; should be a directory in this repo.
.. zuul:jobvar:: target
Optional; if supplied, the target for a multi-stage build.
.. zuul:jobvar:: repository
The name of the target repository in dockerhub for the
image. Supply this even if the image is not going to be
uploaded (it will be tagged with this in the local
registry).
.. zuul:jobvar:: path
Optional; if supplied, the directory that should be passed to
docker build. Useful for building images with a Dockerfile
in the context directory but a source repository elsewhere.
.. zuul:jobvar:: build_args
Optional; if supplied, a list of values to pass to the docker
``--build-arg`` parameter.
abstract: true
pre-run: playbooks/zuul/build-image/pre.yaml
run: playbooks/zuul/build-image/run.yaml
- job:
name: system-config-upload-image
parent: system-config-build-image
description: |
Build and upload a docker image.
.. zuul:jobvar:: images
A list of images to build. Each item in the list should have:
.. zuul:jobvar:: context
The docker build context; should be a directory in this repo.
.. zuul:jobvar:: target
Optional; if supplied, the target for a multi-stage build.
.. zuul:jobvar:: repository
The name of the target repository in dockerhub for the
image. Supply this even if the image is not going to be
uploaded (it will be tagged with this in the local
registry).
.. zuul:jobvar:: credentials
This should be a secret with two keys: ``username`` and
``password``.
abstract: true
post-run: playbooks/zuul/build-image/upload.yaml
secrets:
name: credentials
secret: system-config-dockerhub
- job:
name: system-config-promote-image
description: |
Retag a previously-uploaded docker image.
.. zuul:jobvar:: images
.. zuul:jobvar:: repository
The name of the target repository in dockerhub for the
image.
.. zuul:jobvar:: tags
A list of tags to be added to the image. Default: ['latest'].
.. zuul:jobvar:: credentials
This should be a secret with two keys: ``username`` and
``password``.
abstract: true
run: playbooks/zuul/build-image/promote.yaml
secrets:
name: credentials
secret: system-config-dockerhub
nodeset:
nodes: []
- job:
name: system-config-build-image-gitea
description: Build a gitea image
parent: system-config-build-image
vars: &gitea_vars
images:
- context: docker/gitea
target: gitea
repository: opendevorg/gitea
- context: docker/gitea
target: gitea-openssh
repository: opendevorg/gitea-openssh
files: &gitea_files
- docker/gitea/.*
- job:
name: system-config-upload-image-gitea
description: Build and upload a gitea image
parent: system-config-upload-image
vars: *gitea_vars
files: *gitea_files
- job:
name: system-config-promote-image-gitea
description: Promote a previously published gitea image to latest
parent: system-config-promote-image
vars: *gitea_vars
files: *gitea_files
- job:
name: system-config-build-image-jinja-init
description: Build a jinja-init image
parent: system-config-build-image
vars: &jinja-init_vars
images:
- context: docker/jinja-init
target: jinja-init
repository: opendevorg/jinja-init
files: &jinja-init_files
- docker/jinja-init/.*
- job:
name: system-config-upload-image-jinja-init
description: Build and upload a jinja-init image
parent: system-config-upload-image
vars: *jinja-init_vars
files: *jinja-init_files
- job:
name: system-config-promote-image-jinja-init
description: Promote a previously published jinja-init image to latest
parent: system-config-promote-image
vars: *jinja-init_vars
files: *jinja-init_files
- job:
name: system-config-build-image-gitea-init
description: Build a gitea-init image
parent: system-config-build-image
vars: &gitea-init_vars
images:
- context: docker/gitea-init
target: gitea-init
repository: opendevorg/gitea-init
files: &gitea-init_files
- docker/gitea-init/.*
- job:
name: system-config-upload-image-gitea-init
description: Build and upload a gitea-init image
parent: system-config-upload-image
vars: *gitea-init_vars
files: *gitea-init_files
- job:
name: system-config-promote-image-gitea-init
description: Promote a previously published gitea-init image to latest
parent: system-config-promote-image
vars: *gitea-init_vars
files: *gitea-init_files
- job:
name: system-config-build-image-gerrit
description: Build a gerrit image
parent: system-config-build-image
pre-run: playbooks/zuul/gerrit/repos.yaml
required-projects: &gerrit_projects
- name: gerrit.googlesource.com/gerrit
override-checkout: stable-2.15
- name: gerrit.googlesource.com/plugins/commit-message-length-validator
override-checkout: stable-2.15
- name: gerrit.googlesource.com/plugins/download-commands
override-checkout: stable-2.15
- name: gerrit.googlesource.com/plugins/hooks
override-checkout: stable-2.15
- name: gerrit.googlesource.com/plugins/its-base
override-checkout: stable-2.15
- name: gerrit.googlesource.com/plugins/its-storyboard
override-checkout: stable-2.15
- name: gerrit.googlesource.com/plugins/javamelody
override-checkout: stable-2.15
- name: gerrit.googlesource.com/plugins/replication
override-checkout: stable-2.15
- name: gerrit.googlesource.com/plugins/reviewnotes
override-checkout: stable-2.15
- name: gerrit.googlesource.com/plugins/singleusergroup
override-checkout: stable-2.15
vars: &gerrit_vars
images:
- context: docker/gerrit
target: gerrit
repository: opendevorg/gerrit
path: /home/zuul/src/gerrit.googlesource.com/gerrit
tags:
- 2.15
build_args:
- BAZEL_OPTS="--local_resources=4096,2.0,1.0"
files: &gerrit_files
- docker/gerrit/.*
- playbooks/zuul/gerrit/.*
- job:
name: system-config-upload-image-gerrit
description: Build and upload a gerrit image
parent: system-config-upload-image
pre-run: playbooks/zuul/gerrit/repos.yaml
required-projects: *gerrit_projects
vars: *gerrit_vars
files: *gerrit_files
- job:
name: system-config-promote-image-gerrit
description: Promote a previously published gerrit image to latest
parent: system-config-promote-image
vars: *gerrit_vars
files: *gerrit_files
# Role integration jobs. These test the top-level generic roles/*
# under Zuul. The range of platforms should be the same as those for
# openstack-zuul-jobs.
@ -561,10 +304,6 @@
- system-config-run-eavesdrop
- system-config-run-nodepool
- system-config-run-docker
- system-config-build-image-gitea
- system-config-build-image-jinja-init
- system-config-build-image-gitea-init
- system-config-build-image-gerrit
gate:
jobs:
- tox-linters
@ -578,13 +317,3 @@
- system-config-run-eavesdrop
- system-config-run-nodepool
- system-config-run-docker
- system-config-upload-image-gitea
- system-config-upload-image-jinja-init
- system-config-upload-image-gitea-init
- system-config-upload-image-gerrit
promote:
jobs:
- system-config-promote-image-gitea
- system-config-promote-image-jinja-init
- system-config-promote-image-gitea-init
- system-config-promote-image-gerrit

View File

@ -1,62 +0,0 @@
# Copyright (c) 2019 Red Hat, Inc.
#
# 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.
FROM openjdk:8 as builder
RUN groupadd builder && \
useradd builder --home-dir /usr/src --create-home -g builder
RUN \
echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list \
&& curl -sL https://bazel.build/bazel-release.pub.gpg | apt-key add - \
&& curl -sL https://deb.nodesource.com/setup_8.x | bash - \
&& apt-get update \
&& apt-get install -y bazel nodejs build-essential zip unzip python maven
COPY . /usr/src
RUN chown -R builder /usr/src
USER builder
ARG BAZEL_OPTS
RUN cd /usr/src && bazel build release ${BAZEL_OPTS} && mv bazel-bin/release.war gerrit.war
FROM openjdk:8
RUN apt-get update \
&& apt-get install -y dumb-init \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN addgroup gerrit --system \
&& adduser \
--system \
--home /var/gerrit \
--shell /bin/bash \
--ingroup gerrit \
gerrit
USER gerrit
RUN mkdir /var/gerrit/bin
COPY --from=builder /usr/src/gerrit.war /var/gerrit/bin/gerrit.war
# Allow incoming traffic
EXPOSE 29418 8080
VOLUME /var/gerrit/git /var/gerrit/index /var/gerrit/cache /var/gerrit/db /etc/gerrit /var/log/gerrit
RUN ln -s /var/log/gerrit /var/gerrit/logs && \
ln -s /etc/gerrit /var/gerrit/config
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["/usr/bin/java", "-jar", "/var/gerrit/bin/gerrit.war"]

View File

@ -1,19 +0,0 @@
# Copyright 2018 Red Hat, Inc.
#
# 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.
FROM opendevorg/jinja-init
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]

View File

@ -1,30 +0,0 @@
#!/bin/sh
# Copyright 2018 Red Hat, Inc.
#
# 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.
# Create directories needed by gitea
mkdir -p /data/git
chown 1000:1000 /data/git
mkdir -p /data/gitea
chown 1000:1000 /data/gitea
# This one is used by openssh and can remain root-owned
mkdir -p /data/ssh
# Template the config file (which can also be root-owned)
export JINJA_SRC_FILE=/config_src/app.ini.j2
export JINJA_DEST_FILE=/conf/app.ini
python /run.py

View File

@ -1,115 +0,0 @@
# Copyright (c) 2018 Red Hat, Inc.
# Copyright (c) 2016 The Gitea Authors
# Copyright (c) 2015 The Gogs Authors
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
###################################
#Build stage
FROM golang:1.11-stretch AS build-env
LABEL maintainer="infra-root@openstack.org"
ARG GITEA_VERSION=v1.6.0
ENV TAGS "bindata $TAGS"
#Build deps
RUN apt-get update && apt-get -y install build-essential git \
&& mkdir -p ${GOPATH}/src/code.gitea.io/gitea
#Setup repo
RUN git clone https://github.com/go-gitea/gitea ${GOPATH}/src/code.gitea.io/gitea
WORKDIR ${GOPATH}/src/code.gitea.io/gitea
#Checkout version if set
RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \
&& make clean generate build
###################################
# Basic system setup common to all containers in our pod
FROM debian:testing as base
RUN apt-get update && apt-get -y install \
bash \
ca-certificates \
curl \
gettext \
git \
openssh-client \
tzdata \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN addgroup --system --gid 1000 git \
&& adduser \
--system --no-create-home --disabled-login \
--home /data/git \
--shell /bin/bash \
--uid 1000 \
--gid 1000 \
git \
&& echo "git:$(dd if=/dev/urandom bs=24 count=1 status=none | base64)" | chpasswd \
&& mkdir /custom
# Copy the /etc config files and entrypoint script
COPY --from=build-env /go/src/code.gitea.io/gitea/docker /
# Copy the app
COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
RUN ln -s /app/gitea/gitea /usr/local/bin/gitea
# Copy our custom templates
COPY custom/ /custom/
ENV GITEA_CUSTOM /custom
###################################
# The gitea image
FROM base as gitea
RUN apt-get update && apt-get -y install pandoc \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
EXPOSE 3000
ENV USER git
VOLUME ["/data"]
ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/app/gitea/gitea", "web"]
USER 1000:1000
###################################
# The openssh server image
FROM base as gitea-openssh
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confold" \
install openssh-server \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /run/sshd
COPY sshd-entrypoint.sh /usr/bin/entrypoint
EXPOSE 22
VOLUME ["/data"]
ENTRYPOINT ["/usr/bin/entrypoint"]
CMD ["/usr/sbin/sshd", "-D"]
# this comment is here to perform a test run of the job.....

View File

@ -1,78 +0,0 @@
{{template "base/head" .}}
<div class="home">
<div class="ui stackable middle very relaxed page grid">
<div class="sixteen wide center aligned centered column">
<div class="hero" id="opendev">
<h1 class="ui icon header title">
OpenDev
</h1>
<h2>Free Software Needs Free Tools</h2>
</div>
</div>
</div>
<div class="ui stackable middle very relaxed page grid">
<div class="sixteen wide left aligned centered column">
<p>OpenDev is a space for collaborative Open Source software development.</p>
<p>OpenDevs mission is to provide project hosting, continuous integration tooling,
and virtual collaboration spaces for Open Source software projects. OpenDev is
itself self hosted on this set of tools including Code Review (Gerrit), Continuous
Integration (Zuul), Etherpad, Wiki (mediawiki), Code Browsing (gitea) and so on.
This means that OpenDev itself is run like an open source project, you
can join us and help run the system. Additionally all of the services we run are
open source software themselves.</p>
<h1 id="current-status">Current Status</h1>
<p>We are still very early in the process of building this out. We have DNS servers
and this website running to start.</p>
<p>Most of the services we plan to run will be inherited and rebranded from the
existing community run OpenStack Infrastructure. This means that we do already
have services running, but until we transition them into OpenDev they may say
“OpenStack” across the top or in their URLs.</p>
<h1 id="changes-we-plan-to-make">Changes we plan to make</h1>
<p>There are far too many things to capture here so well go after the highlights instead:</p>
<ul>
<li>Move existing services like Gerrit and Etherpad under the opendev.org domain. Remove OpenStack branding as necessary.</li>
<li>For the code review and CI toolchain treat the services as multitenant. This will likely involve moving code repos around.
<ul>
<li>Well need to build better project renaming and provisioning tools.</li>
</ul></li>
</ul>
<h1 id="join-us">Join Us</h1>
<p>As mentioned previously the OpenDev services themselves are open source software managed on top of Opendev itself. This means that in addition to using OpenDev to host your software development activities you can help us run OpenDev with all of the same tools.</p>
<p>If you use the system and find it useful, wed love to have your help running it as well.</p>
<h1 id="faq">FAQ</h1>
<h2 id="isnt-this-just-openstack-infrastructure-rebranded">Isnt this just OpenStack Infrastructure rebranded?</h2>
<p>It is more than that. We want to make this toolset available to others that would find it helpful. OpenStack would become one of the OpenDev tenants, but other tenants like Zuul or $gizmo would be just as important.</p>
<h2 id="can-i-host-my-project-on-opendev">Can I host my project on OpenDev?</h2>
<p>Yes! However, as noted above it is still early days yet and the early experience might be a bit bumpy. Certain things may still say “OpenStack” on them as we figure out the transition. And while any moves should come with appropriate redirects, we may have some inadvertent misses.</p>
<h2 id="can-i-run-tests-on-windows-or-osx-machines">Can I run tests on Windows or OSX machines?</h2>
<p>Currently all of our test resources are Linux based. Adding additional platforms would likely require someone to help us get that running, but Zuul will support systems with ansible connection plugins. Talk to us!</p>
<h2 id="i-am-an-existing-openstack-infra-user-do-i-need-to-do-anything">I am an existing OpenStack Infra user do I need to do anything?</h2>
<p>No. Well continue to communicate changes as they happen. Well also do our best to make this as smooth a transition as possible. If we run into situations that force us to break something well be sure to let you know at that point.</p>
<h2 id="is-a-cla-required-for-hosted-repos">Is a CLA required for hosted repos?</h2>
<p>No.</p>
<h2 id="what-if-i-dont-like-gerrit-and-would-prefer-insert-tool-here">What if I dont like Gerrit and would prefer (insert tool here)?</h2>
<p>Weve got a fair bit of experience with the existing toolset and adding new tools for which weve already got an answer is currently out of scope. We think the existing tools (like Gerrit) work well, and should only get better as we update them. The system is able to scale because we do not need multiple implementations of different software that solve similar problems.</p>
<h1 id="contact-info">Contact info</h1>
<p>These will be updated when moved to their new OpenDev locations</p>
<ul>
<li>Mailing list: openstack-infra@lists.openstack.org</li>
<li>IRC #openstack-infra on Freenode</li>
</ul>
</div>
</div>
</div>
{{template "base/footer" .}}

View File

@ -1,7 +0,0 @@
#!/bin/bash
set -e
# Generate host keys if necessary
/etc/s6/openssh/setup
exec "$@"

View File

@ -1,35 +0,0 @@
# Copyright 2018 Red Hat, Inc.
#
# 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.
FROM python:slim as build
RUN apt-get update && apt-get -y install \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /src/jinja-init
RUN git clone https://github.com/ObjectifLibre/jinja-init /src/jinja-init
WORKDIR /src/jinja-init
RUN git checkout 8c13a44124a5a363519df787b1cd0abd1198b8df
FROM python:slim as jinja-init
RUN pip install jinja2
COPY --from=build /src/jinja-init/run.py /
ENTRYPOINT ["python", "/run.py"]
# this comment is here to perform a test run of the job...

View File

@ -1,3 +0,0 @@
- hosts: all
roles:
- install-docker

View File

@ -1,20 +0,0 @@
- name: List tags
uri:
url: "https://hub.docker.com/v2/repositories/{{ image.repository }}/tags?page_size=1000"
status_code: 200
register: tags
- name: Set cutoff timestamp to 24 hours ago
command: "python3 -c \"import datetime; print((datetime.datetime.utcnow()-datetime.timedelta(days=1)).strftime('%Y-%m-%dT%H:%M:%fZ'))\""
register: cutoff
- name: Delete all change tags older than the cutoff
no_log: true
loop: "{{ tags.json.results }}"
loop_control:
loop_var: docker_tag
when: docker_tag.last_updated < cutoff.stdout and docker_tag.name.startswith('change_')
uri:
url: "https://hub.docker.com/v2/repositories/{{ image.repository }}/tags/{{ docker_tag.name }}/"
method: DELETE
status_code: 204
headers:
Authorization: "JWT {{ jwt_token.json.token }}"

View File

@ -1,39 +0,0 @@
- name: Get dockerhub token
no_log: true
uri:
url: "https://auth.docker.io/token?service=registry.docker.io&scope=repository:{{ image.repository }}:pull,push"
user: "{{ credentials.username }}"
password: "{{ credentials.password }}"
force_basic_auth: true
register: token
- name: Get manifest
no_log: true
uri:
url: "https://registry.hub.docker.com/v2/{{ image.repository }}/manifests/change_{{ zuul.change }}"
status_code: 200
headers:
Accept: "application/vnd.docker.distribution.manifestv2+json"
Authorization: "Bearer {{ token.json.token }}"
return_content: true
register: manifest
- name: "Put manifest"
no_log: true
loop: "{{ image.tags | default(['latest']) }}"
loop_control:
loop_var: new_tag
uri:
url: "https://registry.hub.docker.com/v2/{{ image.repository }}/manifests/{{ new_tag }}"
method: PUT
status_code: 201
body: "{{ manifest.content | string }}"
headers:
Content-Type: "application/vnd.docker.distribution.manifestv2+json"
Authorization: "Bearer {{ token.json.token }}"
- name: Delete the current change tag
no_log: true
uri:
url: "https://hub.docker.com/v2/repositories/{{ image.repository }}/tags/change_{{ zuul.change }}/"
method: DELETE
status_code: 204
headers:
Authorization: "JWT {{ jwt_token.json.token }}"

View File

@ -1,22 +0,0 @@
- hosts: localhost
tasks:
# This is used by the delete tasks
- name: Get dockerhub JWT token
no_log: true
uri:
url: "https://hub.docker.com/v2/users/login/"
body_format: json
body:
username: "{{ credentials.username }}"
password: "{{ credentials.password }}"
register: jwt_token
- name: Promote image
loop: "{{ images }}"
loop_control:
loop_var: image
include_tasks: promote-retag.yaml
- name: Delete obsolete tags
loop: "{{ images }}"
loop_control:
loop_var: image
include_tasks: promote-delete-tag.yaml

View File

@ -1,15 +0,0 @@
- hosts: all
tasks:
- name: Build a docker image
command: >-
docker build {{ item.path | default('.') }} -f Dockerfile
{% if target | default(false) -%}
--target {{ target }}
{% endif -%}
{% for build_arg in item.build_args | default([]) -%}
--build-arg {{ build_arg }}
{% endfor -%}
--tag {{ item.repository }}:change_{{ zuul.change }}
args:
chdir: "{{ zuul.project.src_dir }}/{{ item.context }}"
loop: "{{ images }}"

View File

@ -1,11 +0,0 @@
- hosts: all
tasks:
- name: Upload image to dockerhub
when: credentials is defined
block:
- name: Log in to dockerhub
command: "docker login -u {{ credentials.username }} -p {{ credentials.password }}"
no_log: true
- name: Upload to dockerhub
command: "docker push {{ item.repository }}:change_{{ zuul.change }}"
loop: "{{ images }}"