resultsdb: Auto-deploy when new image is available

This commit is contained in:
Lukas Holecek 2023-05-18 13:58:36 +02:00 committed by zlopez
parent fca44a415d
commit 90ce359a71
3 changed files with 31 additions and 5 deletions

View file

@ -87,6 +87,11 @@
template: backend/configmaps.yml
objectname: backend-configmaps.yml
- role: openshift/object
app: resultsdb
template: backend/imagestream.yml
objectname: backend-imagestream.yml
- role: openshift/object
app: resultsdb
template: backend/deploymentconfigs.yml

View file

@ -48,11 +48,7 @@ spec:
spec:
containers:
- name: api
{% if env == 'staging' %}
image: "{{ stg_resultsdb_image }}"
{% else %}
image: "{{ prod_resultsdb_image }}"
{% endif %}
image: resultsdb-api
imagePullPolicy: Always
env:
- name: RESULTSDB_WSGI_SCRIPT_PATH
@ -126,3 +122,11 @@ spec:
secretName: resultsdb-fedora-messaging-key
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- api
from:
kind: ImageStreamTag
name: resultsdb-api:latest

View file

@ -0,0 +1,17 @@
---
apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
name: "resultsdb-api"
spec:
tags:
- name: latest
importPolicy:
scheduled: true
from:
kind: DockerImage
{% if env == 'staging' %}
name: "{{ stg_resultsdb_image }}"
{% else %}
name: "{{ prod_resultsdb_image }}"
{% endif %}