Skip to content

Commit

Permalink
restructured repo to typical spsh rollout process
Browse files Browse the repository at this point in the history
  • Loading branch information
M_Westerholz committed Oct 11, 2024
1 parent 9edd39f commit 95566d7
Show file tree
Hide file tree
Showing 11 changed files with 142 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/install-and-run-spsh-loadtest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
name: Install and Run SPSH loadtest Action

on:
workflow_call:
inputs:
instance_name:
type: string
required: true
instance_stage:
type: string
required: true
frontend_hostname:
type: string
required: true
release_tag:
type: string
required: true
dbseeding:
required: false
description: "Enable Seeding (true, false, chart_value)"
default: chart_value
type: string
secrets:
TOKEN:
required: true
KUBECONFIG:
required: true
RC_WEBHOOK:
required: true

permissions:
contents: read

concurrency:
group: spsh-k6-loadtest-rollout-run
cancel-in-progress: true

jobs:
rollout:
runs-on: 'ubuntu-latest'
steps:
- name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
with:
repository: 'dBildungsplattform/schulportal-load-tests'
# change this ref to a branch to test changes
ref: "${{ inputs.release_tag }}"
# ref: "<branch_name>"

- name: Install kubectl and Helm
uses: azure/setup-kubectl@3e0aec4d80787158d308d7b364cb1b702e7feb7f #v4.0.0

- name: Set kubeconfig
run: |
mkdir /home/runner/.kube/
echo "${{ secrets.KUBECONFIG }}" > /home/runner/.kube/config
chmod 600 /home/runner/.kube/config
- name: Helm add repo dbilungsplattform
run: |
helm repo add dbildungsplattform https://dbildungsplattform.github.io/helm-charts-registry/
- name: Rollout spsh-k6-loadtest Helm Chart
run: |
helm upgrade --install \
spsh-k6-loadtest \
./charts/schulportal-load-tests \
--namespace spsh \
--kubeconfig /home/runner/.kube/config \
--wait
33 changes: 33 additions & 0 deletions .github/workflows/publish-image-and-helm-on-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 'Publish image to GHCR and Helm chart to GH pages on tag'

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"

concurrency:
group: spsh-loadtest-main
cancel-in-progress: true

jobs:
publish_docker:
permissions:
packages: write
security-events: write
contents: read
uses: dBildungsplattform/dbp-github-workflows/.github/workflows/[email protected]
with:
image_name: "spsh-k6-loadtest"
run_trivy_scan: true
image_tag_generation: "version_git_tag"
add_latest_tag: true
container_registry: "ghcr.io"
publish_helm:
uses: dBildungsplattform/dbp-github-workflows/.github/workflows/[email protected]
secrets: inherit
with:
chart_name: spsh-k6-loadtest
helm_chart_version_generation: specified
image_tag_generation: specified
helm_chart_version: ${{ github.ref_name }}
image_tag: ${{ github.ref_name }}
24 changes: 24 additions & 0 deletions .github/workflows/publish-image-on-push-to-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Publish image to GHCR on push to branch'

on:
push:
branches-ignore:
- 'main'

concurrency:
group: spsh-loadtest-${{ github.ref }}
cancel-in-progress: true

jobs:
build_and_push:
permissions:
packages: write
security-events: write
contents: read
uses: dBildungsplattform/dbp-github-workflows/.github/workflows/[email protected]
with:
image_name: "spsh-k6-loadtest"
run_trivy_scan: true
image_tag_generation: "ticket_from_branch"
add_latest_tag: false
container_registry: "ghcr.io"
14 changes: 14 additions & 0 deletions .github/workflows/scan-helm-on-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "Scan Helm on push"

on:
push:

concurrency:
group: spsh-loadtest-scan-helm-${{ github.event.ref }}
cancel-in-progress: true

jobs:
scan_helm:
uses: dBildungsplattform/dbp-github-workflows/.github/workflows/[email protected]
permissions:
contents: read
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 95566d7

Please sign in to comment.