-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* worked in qol changes * changed adding latest tag to true * added image tag branch condition * added "" to input tag * test hardcoded image tag * test img tag hard coded 2 * typo * added ticket extraction * added ticket and branch extraction tasks * removed sha from extract branch meta * worked in PR requests * removed start script cause unused * removed on push from trigger loadtests --------- Co-authored-by: M_Westerholz <[email protected]>
- Loading branch information
1 parent
e655e04
commit 0b981a8
Showing
8 changed files
with
96 additions
and
116 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
--- | ||
name: Install SPSH Loadtest Action | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
branch: | ||
type: string | ||
required: false | ||
# default: main | ||
default: DBP-1012-setup-loadtest-env | ||
|
||
secrets: | ||
KUBECONFIG: | ||
required: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: schulportal-load-tests-rollout-run | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
branch_meta: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
branch: ${{ steps.extract_branch_meta.outputs.branch }} | ||
ticket: ${{ steps.extract_branch_ticket.outputs.ticket }} | ||
steps: | ||
- name: Extract branch meta | ||
shell: bash | ||
id: extract_branch_meta | ||
run: | | ||
if [ "${{ github.event_name }}" == 'pull_request' ]; then | ||
echo "branch=${{ github.event.pull_request.head.ref }}" >> $GITHUB_OUTPUT | ||
else | ||
echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Extract project-ticketnumber from branch | ||
id: extract_branch_ticket | ||
run: | | ||
if ${{ github.ref_name == 'main' }}; then | ||
echo "ticket=main" >> $GITHUB_OUTPUT | ||
else | ||
regex='^([[:alpha:]]+?-[[:digit:]]+)' | ||
[[ ${{ steps.extract_branch_meta.outputs.branch }} =~ $regex ]] | ||
echo "ticket=$(echo ${BASH_REMATCH[1]} | tr [A-Z] [a-z])" >> $GITHUB_OUTPUT | ||
fi | ||
rollout: | ||
runs-on: 'ubuntu-latest' | ||
needs: branch_meta | ||
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.branch }}" | ||
|
||
- 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: Rollout schulportal-load-tests Helm Chart | ||
run: | | ||
helm upgrade --install \ | ||
schulportal-load-tests \ | ||
./charts/schulportal-load-tests \ | ||
--namespace spsh \ | ||
--kubeconfig /home/runner/.kube/config \ | ||
--set branch="${{ inputs.branch }}" \ | ||
${{ inputs.branch != 'main' && format('--set imageTag="{0}"', needs.branch_meta.outputs.ticket ) || '--set imageTag="latest"' }} \ | ||
--wait |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,18 @@ | ||
branch: "main" | ||
imageTag: latest #default latest, release oder main ? | ||
port: 5656 | ||
schedule: 0 8 * * * | ||
|
||
cronjobs: | ||
dev-scenario: | ||
scriptPath: 1_goto-sp-oidc.ts # 01, 02, 03 Files | ||
schedule: 0 8 * * * | ||
port: 5656 | ||
serviceName: dev-scenario | ||
# image-tag: latest | ||
imageTag: DBP-1012 | ||
environment: main.dev.spsh.dbildungsplattform.de | ||
# jobsParallelism: not used yet but available? test it | ||
# staging-scenario: | ||
# scriptPath: test.js | ||
# schedule: 0 8 * * * | ||
# port: 5656 | ||
# serviceName: staging-scenario | ||
# image: ghcr.io/dbildungsplattform/schulportal-load-tests:latest | ||
# environment: spsh.staging.dbildungsplattform.de | ||
# prod-scenario: | ||
# scriptPath: test.js | ||
# schedule: 0 8 * * * | ||
# port: 5656 | ||
# prod-scenario: | ||
# serviceName: prod-scenario | ||
# image: ghcr.io/dbildungsplattform/schulportal-load-tests:latest | ||
# environment: spsh.dbildungsplattform.de |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.