Build docker images

So that we can deploy gerritbot in the new world of ansible+docker,
we need container images. Build and publish some.

Change-Id: I3b8a9f7d28af0f9098cfb73051976d7666a46a3c
This commit is contained in:
Monty Taylor 2020-03-28 11:46:00 -05:00
parent 29ff7b3bec
commit 83f3097608
2 changed files with 78 additions and 0 deletions

View File

@ -1,9 +1,61 @@
- secret:
name: gerritbot-opendev-dockerhub
data:
username: opendevzuul
password: !encrypted/pkcs1-oaep
- 1lrelk7zn4fl31rF2n/+erP4aYWXWfHMnt7piYyBtfSlbIh3z+u8BIDY5/LXU9bswwxVR
IKRmMSME8sH4wE9+DAmsGiiuEuVdq2fKu7jF2doL86EVYsOMYtOJak7jN1l5mOHWn/IZy
lKATn/OaAHosX8un30T9pSn4cNCtsdbIRxxjXJUdprZfbcDHAJ5Ezf5PsBs9Szg/SUZWU
DLVvAYoTpyYHTHQMCf1idKevAnewrDLtPuIjVf0FWmMsRURBh5HVZILVn6NFCHQZR93ca
mzNpQOaw/v/F+hjtKZSFRbuwuOe1st5qK1KLbzb0xYJ0DhM5bIKO/O3gTKwWV30+0rEJC
geouNC+qhhVRGAqvA3y1DJZNYcY4lGTYE2hMhaIKBm1tj1UpzbexVU66NTUZ6xAzsq28c
D2ffLmVMeNtnZUud1JiwpeHOGB/zwpJJTcJBHI9bzn19NNF9MhnRGbaJUU69goPgc8O17
HD18TsHAGm4mJwLNp8zWUb0VMP06v8PHI7clRAK07FUN6Gc7mjdgGoPI1RtLoZ8Fr0Il7
vbfU6acyzrH/CIyF5mNvrUBuy3J6QoKElFG2pXGfZj8xKhCTbShT2rZwyZdhgONvjNWIN
cY8abkqFpILCTTEtByIs0A02XJLOf9XdK5R3/yPPNhv5OPSfBTwpIgwLsAJqPU=
- job:
name: gerritbot-build-opendev-image
parent: opendev-build-docker-image
description: Build OpenDev Docker images for storyboard webclient
vars: &gerritbot_opendev_image_vars
zuul_work_dir: src/opendev.org/opendev/gerritbot
docker_images:
- context: .
repository: opendevorg/gerritbot
target: gerritbot
- job:
name: gerritbot-upload-opendev-image
parent: opendev-upload-docker-image
description: Build OpenDev gerritbot Docker images and upload to Docker Hub.
vars: *gerritbot_opendev_image_vars
secrets:
- name: docker_credentials
secret: gerritbot-opendev-dockerhub
pass-to-parent: true
- job:
name: gerritbot-promote-opendev-image
parent: opendev-promote-docker-image
description: Promote previously uploaded gerritbot Docker images.
vars: *gerritbot_opendev_image_vars
secrets:
- name: docker_credentials
secret: gerritbot-opendev-dockerhub
pass-to-parent: true
- project:
check:
jobs:
- tox-pep8
- tox-py37
- gerritbot-build-opendev-image
gate:
jobs:
- tox-pep8
- tox-py37
- gerritbot-upload-opendev-image
promote:
jobs:
- gerritbot-promote-opendev-image

26
Dockerfile Normal file
View File

@ -0,0 +1,26 @@
# Copyright 2019 Red Hat, Inc.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this software. If not, see <http://www.gnu.org/licenses/>.
FROM opendevorg/python-builder:3.7 as builder
COPY . /tmp/src
RUN assemble
FROM opendevorg/python-base:3.7 as gerritbot
COPY --from=builder /output/ /output
RUN /output/install-from-bindep
CMD ["/usr/local/bin/gerritbot", "/etc/gerritbot/gerritbot.config"]