Skip to content

Commit

Permalink
chore: add release-candidate system (#357)
Browse files Browse the repository at this point in the history
* CI: add release-candidate system

* ⬆️  Upgrade to 7.1.4
  • Loading branch information
Thomas GRUSON authored Oct 30, 2020
1 parent bb250bd commit df8e405
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 14 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/build-back.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ on:
- 'code/**'
branches:
- 'main'
- 'develop'
tags:
- 'ara-*.*.*'
pull_request:
types: [opened, synchronize, reopened, labeled]
paths:
- 'code/**'
branches:
- 'main'
- 'develop'

jobs:
docker:
Expand All @@ -28,15 +35,18 @@ jobs:
if [ "${{ github.event_name }}" = "schedule" ]; then
VERSION=nightly
elif [[ $GITHUB_REF == refs/tags/* ]]; then
GITHUB_TAGS=${GITHUB_REF#refs/tags/}
VERSION=${GITHUB_TAGS:4}
GITHUB_TAG=${GITHUB_REF#refs/tags/}
VERSION=${GITHUB_TAG#ara-}
elif [[ $GITHUB_REF == refs/heads/* ]]; then
VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
if [ "${{ github.event.repository.default_branch }}" = "$VERSION" ]; then
VERSION=edge
fi
elif [[ $GITHUB_REF == refs/pull/* ]]; then
VERSION=pr-${{ github.event.number }}
if [[ "${{ toJson(github.event.pull_request.labels.*.name) }}" == *"release-candidate"* ]]; then
VERSION=RC-$(echo -n ${$(cat charts/stable/Chart.yaml | grep version)#version:})
fi
fi
TAGS="${DOCKER_IMAGE}:${VERSION}"
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
Expand All @@ -55,7 +65,7 @@ jobs:
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'release-candidate')
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand All @@ -68,7 +78,7 @@ jobs:
context: ./code/api
file: ./code/api/Dockerfile
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'release-candidate') }}
tags: ${{ steps.prep.outputs.tags }}
labels: |
org.opencontainers.image.title=${{ github.event.repository.name }}
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/build-front.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ on:
- 'code/**'
branches:
- 'main'
- 'develop'
tags:
- 'ara-*.*.*'
pull_request:
types: [opened, synchronize, reopened, labeled]
paths:
- 'code/**'
branches:
- 'main'
- 'develop'

jobs:
docker:
Expand All @@ -28,15 +35,18 @@ jobs:
if [ "${{ github.event_name }}" = "schedule" ]; then
VERSION=nightly
elif [[ $GITHUB_REF == refs/tags/* ]]; then
GITHUB_TAGS=${GITHUB_REF#refs/tags/}
VERSION=${GITHUB_TAGS:4}
GITHUB_TAG=${GITHUB_REF#refs/tags/}
VERSION=${GITHUB_TAG#ara-}
elif [[ $GITHUB_REF == refs/heads/* ]]; then
VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
if [ "${{ github.event.repository.default_branch }}" = "$VERSION" ]; then
VERSION=edge
fi
elif [[ $GITHUB_REF == refs/pull/* ]]; then
VERSION=pr-${{ github.event.number }}
if [[ "${{ toJson(github.event.pull_request.labels.*.name) }}" == *"release-candidate"* ]]; then
VERSION=RC-$(echo -n ${$(cat charts/stable/Chart.yaml | grep version)#version:})
fi
fi
TAGS="${DOCKER_IMAGE}:${VERSION}"
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
Expand All @@ -55,7 +65,7 @@ jobs:
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'release-candidate')
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand All @@ -68,7 +78,7 @@ jobs:
context: ./code/web-ui
file: ./code/web-ui/Dockerfile
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'release-candidate') }}
tags: ${{ steps.prep.outputs.tags }}
labels: |
org.opencontainers.image.title=${{ github.event.repository.name }}
Expand Down
2 changes: 1 addition & 1 deletion charts/stable/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: ara
version: 7.1.3
version: 7.1.4
home: https://github.com/Decathlon/ara
description: |
ARA helps you to fight against regressions by letting it preanalyze your non-regression tests runs,
Expand Down
4 changes: 4 additions & 0 deletions charts/stable/templates/deploy-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/version: {{ .Chart.Version }}
app.kubernetes.io/component: {{ $name }}
{{- if .Values.api.annotations }}
annotations:
{{ toYaml .Values.api.annotations | indent 4 }}
{{- end }}
spec:
replicas: {{ .Values.api.replicas }}
selector:
Expand Down
4 changes: 4 additions & 0 deletions charts/stable/templates/deploy-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/version: {{ .Chart.Version }}
app.kubernetes.io/component: {{ $name }}
{{- if .Values.ui.annotations }}
annotations:
{{ toYaml .Values.ui.annotations | indent 4 }}
{{- end }}
spec:
replicas: {{ .Values.ui.replicas }}
selector:
Expand Down
2 changes: 2 additions & 0 deletions charts/stable/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ image:
##
api:
replicas: 1
annotations: {}
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
Expand All @@ -35,6 +36,7 @@ api:
##
ui:
replicas: 1
annotations: {}
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
Expand Down
2 changes: 1 addition & 1 deletion code/api/database/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<groupId>com.decathlon.ara</groupId>
<artifactId>ara-database</artifactId>
<version>7.1.3</version>
<version>7.1.4</version>

<name>ARA Database</name>
<description>
Expand Down
2 changes: 1 addition & 1 deletion code/api/generated-cucumber-report/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<groupId>com.decathlon.ara</groupId>
<artifactId>ara-generated-cucumber-report</artifactId>
<version>7.1.3</version>
<version>7.1.4</version>

<name>ARA Cucumber</name>
<description>
Expand Down
2 changes: 1 addition & 1 deletion code/api/lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<groupId>com.decathlon.ara</groupId>
<artifactId>ara-lib</artifactId>
<version>7.1.3</version>
<version>7.1.4</version>

<properties>
<java.version>14</java.version>
Expand Down
2 changes: 1 addition & 1 deletion code/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<groupId>com.decathlon.ara</groupId>
<artifactId>ara-parent</artifactId>
<packaging>pom</packaging>
<version>7.1.3</version>
<version>7.1.4</version>

<name>ARA Parent</name>
<description>
Expand Down
2 changes: 1 addition & 1 deletion code/api/server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<groupId>com.decathlon.ara</groupId>
<artifactId>ara-server</artifactId>
<version>7.1.3</version>
<version>7.1.4</version>

<name>ARA Server</name>
<description>
Expand Down

0 comments on commit df8e405

Please sign in to comment.