Bodhi: Split the buildconfig for stg and for prod

This way we can change things in staging without impacting production since
we're in freeze.
Once the freeze is over, we'll likely want to migrate production to the new
way.
While splitting the buildconfig, we're also moving out the docker files to
make the file easier to read.

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
Pierre-Yves Chibon 2019-10-10 15:31:59 +02:00
parent ebe8d4728a
commit 77670b9610
6 changed files with 164 additions and 0 deletions

View file

@ -84,6 +84,12 @@
app: bodhi
template: buildconfig.yml
objectname: buildconfig.yml
when: env == "production"
- role: openshift/object
app: bodhi
template: buildconfig-stg.yml
objectname: buildconfig.yml
when: env == "staging"
- role: openshift/start-build
app: bodhi
buildname: bodhi-base

View file

@ -0,0 +1,121 @@
{% macro load_file(filename) %}{% include filename %}{%- endmacro -%}
apiVersion: v1
items:
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
build: bodhi-base
name: bodhi-base
spec:
runPolicy: Serial
source:
dockerfile: |-
{{ load_file('dockerfile') | indent }}
type: Dockerfile
strategy:
type: Docker
dockerStrategy:
noCache: false
output:
to:
kind: ImageStreamTag
name: bodhi-base:latest
kind: List
metadata: {}
---
apiVersion: v1
items:
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
build: bodhi-web
name: bodhi-web
spec:
runPolicy: Serial
source:
dockerfile: |-
{{ load_file('dockerfile-web') | indent }}
type: Dockerfile
strategy:
type: Docker
dockerStrategy:
from:
kind: "ImageStreamTag"
name: "bodhi-base:latest"
noCache: false
triggers:
- type: "imageChange"
imageChange: {}
output:
to:
kind: ImageStreamTag
name: bodhi-web:latest
kind: List
metadata: {}
---
apiVersion: v1
items:
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
build: bodhi-consumer
name: bodhi-consumer
spec:
runPolicy: Serial
source:
dockerfile: |-
{{ load_file('dockerfile-consumer') | indent }}
type: Dockerfile
strategy:
type: Docker
dockerStrategy:
from:
kind: "ImageStreamTag"
name: "bodhi-base:latest"
noCache: false
triggers:
- type: "imageChange"
imageChange: {}
output:
to:
kind: ImageStreamTag
name: bodhi-consumer:latest
kind: List
metadata: {}
---
apiVersion: v1
items:
- apiVersion: v1
kind: BuildConfig
metadata:
labels:
build: bodhi-celery
name: bodhi-celery
spec:
runPolicy: Serial
source:
dockerfile: |-
{{ load_file('dockerfile-celery') | indent }}
type: Dockerfile
strategy:
type: Docker
dockerStrategy:
from:
kind: "ImageStreamTag"
name: "bodhi-base:latest"
noCache: false
triggers:
- type: "imageChange"
imageChange: {}
output:
to:
kind: ImageStreamTag
name: bodhi-celery:latest
kind: List
metadata: {}

View file

@ -0,0 +1,17 @@
FROM fedora:30
LABEL \
name="bodhi-base" \
vendor="Fedora Infrastructure" \
license="MIT"
RUN curl -o /etc/yum.repos.d/infra-tags.repo https://infrastructure.fedoraproject.org/cgit/ansible.git/plain/files/common/fedora-infra-tags.repo
{% if env == "staging" %}
RUN curl -o /etc/yum.repos.d/infra-tags-stg.repo https://infrastructure.fedoraproject.org/cgit/ansible.git/plain/files/common/fedora-infra-tags-stg.repo
{% endif %}
# While dnf has a --nodocs, it doesen't have a --docs...
RUN sed -i '/nodocs/d' /etc/dnf/dnf.conf
RUN dnf install -y bodhi-server-{{bodhi_version}}
# Set up krb5
RUN rm -f /etc/krb5.conf && \
ln -sf /etc/bodhi/krb5.conf /etc/krb5.conf && \
ln -sf /etc/keytabs/koji-keytab /etc/krb5.bodhi_bodhi{{ env_suffix }}.fedoraproject.org.keytab
ENV USER=openshift

View file

@ -0,0 +1,6 @@
FROM bodhi-base
LABEL \
name="bodhi-celery" \
vendor="Fedora Infrastructure" \
license="MIT"
ENTRYPOINT /usr/bin/celery worker -A bodhi.server.tasks.app -l info -Q celery

View file

@ -0,0 +1,6 @@
FROM bodhi-base
LABEL \
name="bodhi-consumer" \
vendor="Fedora Infrastructure" \
license="MIT"
ENTRYPOINT /usr/bin/fedora-messaging consume

View file

@ -0,0 +1,8 @@
FROM bodhi-base
LABEL \
name="bodhi-web" \
vendor="Fedora Infrastructure" \
license="MIT"
RUN dnf install --refresh -y bodhi-docs-{{bodhi_version}} python3-pyramid_sawing
EXPOSE 8080
ENTRYPOINT bash /etc/bodhi/start.sh