whatcanidoforfedora: use staging/production branch to trigger build in openshift

Signed-off-by: Clement Verna <cverna@tutanota.com>
This commit is contained in:
Clement Verna 2019-01-08 20:13:20 +01:00
parent 0ba7f609e7
commit f61e597b5b
3 changed files with 34 additions and 20 deletions

View file

@ -22,7 +22,7 @@
- role: openshift/object - role: openshift/object
app: asknot app: asknot
file: buildconfig.yml template: buildconfig.yml
objectname: buildconfig.yml objectname: buildconfig.yml
- role: openshift/start-build - role: openshift/start-build

View file

@ -1,19 +0,0 @@
apiVersion: v1
kind: BuildConfig
metadata:
name: asknot-build
labels:
environment: "asknot"
spec:
source:
git:
uri: https://github.com/fedora-infra/asknot-ng.git
ref: "os-staging"
strategy:
type: Docker
triggers:
- type: ImageChange
output:
to:
kind: ImageStreamTag
name: asknot:latest

View file

@ -0,0 +1,33 @@
apiVersion: v1
kind: BuildConfig
metadata:
name: asknot-build
labels:
environment: "asknot"
spec:
source:
git:
uri: https://github.com/fedora-infra/asknot-ng.git
{% if env == 'staging' %}
ref: "staging"
{% else %}
ref: "production"
{% endif %}
strategy:
type: Docker
triggers:
{% if stg_asknot_github_secret is defined and env == 'staging' %}
- type: GitHub
github:
secret: "{{ stg_asknot_github_secret }}"
{% elif asknot_github_secret is defined and env == 'production' %}
- type: GitHub
github:
secret: "{{ asknot_github_secret }}"
{% endif %}
- type: ConfigChange
- type: ImageChange
output:
to:
kind: ImageStreamTag
name: asknot:latest