whatcanidoforfedora: use staging/production branch to trigger build in openshift
Signed-off-by: Clement Verna <cverna@tutanota.com>
This commit is contained in:
parent
0ba7f609e7
commit
f61e597b5b
3 changed files with 34 additions and 20 deletions
|
@ -22,7 +22,7 @@
|
|||
|
||||
- role: openshift/object
|
||||
app: asknot
|
||||
file: buildconfig.yml
|
||||
template: buildconfig.yml
|
||||
objectname: buildconfig.yml
|
||||
|
||||
- role: openshift/start-build
|
||||
|
|
|
@ -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
|
33
roles/openshift-apps/asknot/templates/buildconfig.yml
Normal file
33
roles/openshift-apps/asknot/templates/buildconfig.yml
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue