From aa71ec078eb3b2479b56898fbe99cab9f180f9e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Tue, 10 Dec 2019 14:49:15 +0100 Subject: [PATCH] Build bugzilla2fedmsg in openshift using s2i MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Bompard --- .../bugzilla2fedmsg/templates/buildconfig.yml | 27 +++++++---------- .../bugzilla2fedmsg/templates/configmap.yml | 2 +- .../templates/deploymentconfig.yml | 29 +++++-------------- 3 files changed, 19 insertions(+), 39 deletions(-) diff --git a/roles/openshift-apps/bugzilla2fedmsg/templates/buildconfig.yml b/roles/openshift-apps/bugzilla2fedmsg/templates/buildconfig.yml index 5d8fcb157b..88f240327a 100644 --- a/roles/openshift-apps/bugzilla2fedmsg/templates/buildconfig.yml +++ b/roles/openshift-apps/bugzilla2fedmsg/templates/buildconfig.yml @@ -6,26 +6,19 @@ metadata: environment: "bugzilla2fedmsg" spec: source: - type: Dockerfile - dockerfile: |- - FROM fedora:31 - LABEL \ - name="bugzilla2fedmsg" \ - 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 %} - RUN dnf install -y bugzilla2fedmsg - ENV USER=openshift - ENTRYPOINT /usr/bin/bugzilla2fedmsg + type: Git + git: + uri: https://github.com/fedora-infra/bugzilla2fedmsg.git strategy: - type: Docker - dockerStrategy: - noCache: false + type: Source + sourceStrategy: + from: + kind: ImageStreamTag + namespace: openshift + name: python:3.6 triggers: - type: ImageChange + - type: ConfigChange output: to: kind: ImageStreamTag diff --git a/roles/openshift-apps/bugzilla2fedmsg/templates/configmap.yml b/roles/openshift-apps/bugzilla2fedmsg/templates/configmap.yml index bd945e8ec0..da66275238 100644 --- a/roles/openshift-apps/bugzilla2fedmsg/templates/configmap.yml +++ b/roles/openshift-apps/bugzilla2fedmsg/templates/configmap.yml @@ -7,6 +7,6 @@ metadata: labels: app: bugzilla2fedmsg data: - fedora-messaging.toml: |- + config.toml: |- {{ load_file('fedora-messaging.toml') | indent }} diff --git a/roles/openshift-apps/bugzilla2fedmsg/templates/deploymentconfig.yml b/roles/openshift-apps/bugzilla2fedmsg/templates/deploymentconfig.yml index 380eec2f5d..abaf43a328 100644 --- a/roles/openshift-apps/bugzilla2fedmsg/templates/deploymentconfig.yml +++ b/roles/openshift-apps/bugzilla2fedmsg/templates/deploymentconfig.yml @@ -2,12 +2,12 @@ apiVersion: v1 kind: DeploymentConfig metadata: + name: bugzilla2fedmsg labels: app: bugzilla2fedmsg service: bugzilla2fedmsg - name: bugzilla2fedmsg spec: - replicas: 2 + replicas: 1 selector: app: bugzilla2fedmsg deploymentconfig: bugzilla2fedmsg @@ -20,14 +20,13 @@ spec: deploymentconfig: bugzilla2fedmsg spec: containers: - - image: bugzilla2fedmsg:latest - name: bugzilla2fedmsg + - name: bugzilla2fedmsg + image: bugzilla2fedmsg:latest env: - - name: APP_MODULE - value: "bugzilla2fedmsg:app" - ports: - - containerPort: 8080 - protocol: TCP + - name: APP_SCRIPT + value: "bugzilla2fedmsg" + # - name: FEDORA_MESSAGING_CONF + # value: "/etc/fedora-messaging/config.toml" volumeMounts: - name: fedora-messaging-config-volume mountPath: /etc/fedora-messaging @@ -52,18 +51,6 @@ spec: mountPath: /etc/pki/stomp/msg-client-fedora-prod.key subPath: msg-client-fedora-prod.key readOnly: true - readinessProbe: - timeoutSeconds: 1 - initialDelaySeconds: 5 - httpGet: - path: / - port: 8080 - livenessProbe: - timeoutSeconds: 1 - initialDelaySeconds: 30 - httpGet: - path: / - port: 8080 volumes: - name: fedora-messaging-config-volume configMap: