Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 52 additions & 47 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,23 @@ jobs:
- name: Login to Quay.io Container Registry
uses: docker/login-action@v3
with:
registry: registry.puzzle.ch
username: ${{ secrets.PUZZLE_REG_USERNAME }}
password: ${{ secrets.PUZZLE_REG_TOKEN }}

- name: Build Puzzle Version
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
push: true
tags: |
registry.puzzle.ch/puzzle/quarkus-techlab:pr-${{ github.event.pull_request.number }}
registry: quay.io
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_PW }}
# uses: docker/login-action@v3
# with:
# registry: registry.puzzle.ch
# username: ${{ secrets.PUZZLE_REG_USERNAME }}
# password: ${{ secrets.PUZZLE_REG_TOKEN }}

# - name: Build Puzzle Version
# uses: docker/build-push-action@v6
# with:
# context: .
# file: ./Dockerfile
# push: true
# tags: |
# registry.puzzle.ch/puzzle/quarkus-techlab:pr-${{ github.event.pull_request.number }}

- name: Build Mobi Version
uses: docker/build-push-action@v6
Expand All @@ -51,7 +56,7 @@ jobs:
TRAINING_HUGO_ENV=mobi
push: true
tags: |
registry.puzzle.ch/puzzle/quarkus-techlab:pr-${{ github.event.pull_request.number }}-mobi
quay.io/acend/quarkus-techlab:pr-${{ github.event.pull_request.number }}-mobi

- name: 'Install Helm'
uses: azure/setup-helm@v3
Expand All @@ -70,38 +75,38 @@ jobs:
mkdir -p $HOME/.kube
echo "$KUBE_CONFIG" > $HOME/.kube/config

- name: Deploy Helm Release
env:
TRAINING_HELM_RELEASE: 'pr-${{ github.event.pull_request.number }}'
TRAINING_NAMESPACE: 'pitc-cicd-quarkus-techlab-test'
TRAINING_VERSION: '${{ github.sha }}'
run: |
helm upgrade $TRAINING_HELM_RELEASE acend-training-chart --install --wait \
--kubeconfig $HOME/.kube/config \
--namespace=$TRAINING_NAMESPACE \
--set=app.name=$HELM_RELEASE \
--set=app.version=$TRAINING_VERSION \
--repo=https://acend.github.io/helm-charts/ \
--values=helm-chart/values.yaml --atomic

- name: Redeploy Deployments
env:
TRAINING_HELM_RELEASE: 'pr-${{ github.event.pull_request.number }}'
TRAINING_NAMESPACE: 'pitc-cicd-quarkus-techlab-test'
run: |
kubectl rollout restart deployment/$TRAINING_HELM_RELEASE-quarkus-techlab-puzzle \
--kubeconfig $HOME/.kube/config \
--namespace $TRAINING_NAMESPACE
kubectl rollout restart deployment/$TRAINING_HELM_RELEASE-quarkus-techlab-mobi \
--kubeconfig $HOME/.kube/config \
--namespace $TRAINING_NAMESPACE

- name: Comment PR Environments in PR
uses: marocchino/sticky-pull-request-comment@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: |
PR Environments:
* puzzle <https://quarkus-techlab-pr-${{ github.event.pull_request.number }}.ocp.cloudscale.puzzle.ch>
* mobi <https://quarkus-techlab-mobi-pr-${{ github.event.pull_request.number }}.ocp.cloudscale.puzzle.ch>
# - name: Deploy Helm Release
# env:
# TRAINING_HELM_RELEASE: 'pr-${{ github.event.pull_request.number }}'
# TRAINING_NAMESPACE: 'pitc-cicd-quarkus-techlab-test'
# TRAINING_VERSION: '${{ github.sha }}'
# run: |
# helm upgrade $TRAINING_HELM_RELEASE acend-training-chart --install --wait \
# --kubeconfig $HOME/.kube/config \
# --namespace=$TRAINING_NAMESPACE \
# --set=app.name=$HELM_RELEASE \
# --set=app.version=$TRAINING_VERSION \
# --repo=https://acend.github.io/helm-charts/ \
# --values=helm-chart/values.yaml --atomic
#
# - name: Redeploy Deployments
# env:
# TRAINING_HELM_RELEASE: 'pr-${{ github.event.pull_request.number }}'
# TRAINING_NAMESPACE: 'pitc-cicd-quarkus-techlab-test'
# run: |
# kubectl rollout restart deployment/$TRAINING_HELM_RELEASE-quarkus-techlab-puzzle \
# --kubeconfig $HOME/.kube/config \
# --namespace $TRAINING_NAMESPACE
# kubectl rollout restart deployment/$TRAINING_HELM_RELEASE-quarkus-techlab-mobi \
# --kubeconfig $HOME/.kube/config \
# --namespace $TRAINING_NAMESPACE
#
# - name: Comment PR Environments in PR
# uses: marocchino/sticky-pull-request-comment@v2
# with:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# message: |
# PR Environments:
# * puzzle <https://quarkus-techlab-pr-${{ github.event.pull_request.number }}.ocp.cloudscale.puzzle.ch>
# * mobi <https://quarkus-techlab-mobi-pr-${{ github.event.pull_request.number }}.ocp.cloudscale.puzzle.ch>

32 changes: 16 additions & 16 deletions .github/workflows/pr-cleanup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ jobs:
mkdir -p $HOME/.kube
echo "$KUBE_CONFIG" > $HOME/.kube/config

- name: Remove PR Environment Helm Release
env:
TRAINING_HELM_RELEASE: 'pr-${{ github.event.pull_request.number }}'
TRAINING_NAMESPACE: 'pitc-cicd-quarkus-techlab-test'
TRAINING_VERSION: '${{ github.sha }}'
run: |
helm uninstall $TRAINING_HELM_RELEASE --kubeconfig $HOME/.kube/config --namespace=$TRAINING_NAMESPACE

- name: Delete Tags on Quay
id: delete_tags
env:
PR_NUMBER: '${{ github.event.pull_request.number }}'
QUAYIO_API_TOKEN: '${{ secrets.QUAYIO_API_TOKEN }}'
REPOSITORY: '${{ github.repository }}'
run: |
curl -X DELETE -H "Authorization: Bearer ${QUAYIO_API_TOKEN}" https://quay.io/api/v1/repository/${REPOSITORY}/tag/pr-${PR_NUMBER}{,-mobi}
# - name: Remove PR Environment Helm Release
# env:
# TRAINING_HELM_RELEASE: 'pr-${{ github.event.pull_request.number }}'
# TRAINING_NAMESPACE: 'pitc-cicd-quarkus-techlab-test'
# TRAINING_VERSION: '${{ github.sha }}'
# run: |
# helm uninstall $TRAINING_HELM_RELEASE --kubeconfig $HOME/.kube/config --namespace=$TRAINING_NAMESPACE
#
# - name: Delete Tags on Quay
# id: delete_tags
# env:
# PR_NUMBER: '${{ github.event.pull_request.number }}'
# QUAYIO_API_TOKEN: '${{ secrets.QUAYIO_API_TOKEN }}'
# REPOSITORY: '${{ github.repository }}'
# run: |
# curl -X DELETE -H "Authorization: Bearer ${QUAYIO_API_TOKEN}" https://quay.io/api/v1/repository/${REPOSITORY}/tag/pr-${PR_NUMBER}{,-mobi}
47 changes: 25 additions & 22 deletions .github/workflows/push-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ jobs:
- name: Login to Quay.io Container Registry
uses: docker/login-action@v3
with:
registry: registry.puzzle.ch
username: ${{ secrets.PUZZLE_REG_USERNAME }}
password: ${{ secrets.PUZZLE_REG_TOKEN }}
registry: quay.io
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_PW }}
# registry: registry.puzzle.ch
# username: ${{ secrets.PUZZLE_REG_USERNAME }}
# password: ${{ secrets.PUZZLE_REG_TOKEN }}

- name: Build Puzzle Version
uses: docker/build-push-action@v5
Expand All @@ -43,24 +46,24 @@ jobs:
file: ./Dockerfile
push: true
tags: |
registry.puzzle.ch/puzzle/quarkus-techlab:latest

- name: Run vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'registry.puzzle.ch/puzzle/quarkus-techlab:latest'
format: 'table'
output: 'trivy-results.txt'
exit-code: '0'
ignore-unfixed: true
vuln-type: 'os'
severity: 'CRITICAL,HIGH'

- name: Archive vulnerability scan results
uses: actions/upload-artifact@v4
with:
name: trivy-results-main
path: trivy-results.txt
quay.io/acend/quarkus-techlab:latest

# - name: Run vulnerability scanner
# uses: aquasecurity/trivy-action@master
# with:
# image-ref: 'registry.puzzle.ch/puzzle/quarkus-techlab:latest'
# format: 'table'
# output: 'trivy-results.txt'
# exit-code: '0'
# ignore-unfixed: true
# vuln-type: 'os'
# severity: 'CRITICAL,HIGH'

# - name: Archive vulnerability scan results
# uses: actions/upload-artifact@v4
# with:
# name: trivy-results-main
# path: trivy-results.txt

- name: Build Mobi Version
uses: docker/build-push-action@v5
Expand All @@ -71,7 +74,7 @@ jobs:
TRAINING_HUGO_ENV=mobi
push: true
tags: |
registry.puzzle.ch/puzzle/quarkus-techlab:latest-mobi
quay.io/acend/quarkus-techlab:latest-mobi

- name: 'Install Helm'
uses: azure/setup-helm@v3
Expand Down
2 changes: 1 addition & 1 deletion helm-chart/values-acend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ acendTraining:
name: mobi
replicaCount: 1
image:
repository: registry.puzzle.ch/puzzle/quarkus-techlab
repository: quay.io/acend/quarkus-techlab
pullPolicy: Always
tag: ""
tagsuffix: "-mobi"
Expand Down
4 changes: 2 additions & 2 deletions helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ acendTraining:
name: puzzle
replicaCount: 1
image:
repository: registry.puzzle.ch/puzzle/quarkus-techlab
repository: quay.io/acend/quarkus-techlab
pullPolicy: Always
tag: ""
tagsuffix: ""
Expand All @@ -22,7 +22,7 @@ acendTraining:
name: mobi
replicaCount: 1
image:
repository: registry.puzzle.ch/puzzle/quarkus-techlab
repository: quay.io/acend/quarkus-techlab
pullPolicy: Always
tag: ""
tagsuffix: "-mobi"
Expand Down