Skip to content

Commit

Permalink
Tagging for Releases/Latest/Master (#56)
Browse files Browse the repository at this point in the history
* tagging master, adding release tagging, currently fork

* removed fork

* changed job name to release

* changed trigger to use release

* removed latest conditionals

Co-authored-by: Derek Wasinger <[email protected]>
  • Loading branch information
dwasinge and Derek Wasinger authored Apr 29, 2020
1 parent b076da0 commit cb54402
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ jobs:
image_push_registry: quay.io
image_push_username: ${{ secrets.QUAY_USERNAME }}
image_push_password: ${{ secrets.QUAY_PASSWORD }}
image_tags: master
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Add Tags to Release

on:
release:
types: [published]

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: get the release version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: tag with release version
uses: tinact/[email protected]
with:
image_name: rht-labs/omp-backend
image_old_tag: ${{ github.sha }}
image_new_tag: ${{ steps.get_version.outputs.VERSION }}
registry: quay.io
registry_username: ${{ secrets.QUAY_USERNAME }}
registry_password: ${{ secrets.QUAY_PASSWORD }}
- name: tag with latest
uses: tinact/[email protected]
with:
image_name: rht-labs/omp-backend
image_old_tag: ${{ github.sha }}
registry: quay.io
registry_username: ${{ secrets.QUAY_USERNAME }}
registry_password: ${{ secrets.QUAY_PASSWORD }}
6 changes: 0 additions & 6 deletions deployment/templates/deploymentconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ spec:
- envFrom:
- secretRef:
name: omp-backend-configuration
{{- if eq .Values.imageTag "latest" }}
image: {{ .Values.name }}:{{ .Values.imageTag }}
{{- else }}
image: {{ .Values.imageName }}:{{ .Values.imageTag }}
{{- end }}
imagePullPolicy: Always
name: {{ .Values.name }}
ports:
Expand All @@ -59,7 +55,6 @@ spec:
test: false
triggers:
- type: ConfigChange
{{- if eq .Values.imageTag "latest" }}
- type: ImageChange
imageChangeParams:
automatic: true
Expand All @@ -68,4 +63,3 @@ spec:
name: {{ .Values.name }}:{{ .Values.imageTag }}
containerNames:
- {{ .Values.name }}
{{- end }}
2 changes: 0 additions & 2 deletions deployment/templates/imagestream.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{- if or (eq .Values.imageTag "latest") (.Values.development) }}
---
apiVersion: image.openshift.io/v1
kind: ImageStream
Expand All @@ -21,4 +20,3 @@ spec:
referencePolicy:
type: Source
{{- end }}
{{- end }}

0 comments on commit cb54402

Please sign in to comment.