Skip to content

Commit

Permalink
added ticket extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
M_Westerholz committed Oct 16, 2024
1 parent c923587 commit 2e8c66c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/install-spsh-loadtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,32 @@ concurrency:
cancel-in-progress: true

jobs:
branch_meta:
runs-on: ubuntu-latest
outputs:
ticket: ${{ steps.extract_branch_ticket.outputs.ticket }}
steps:
- 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 }}"
ref: "DBP-1012-setup-loadtest-env"
ref: "${{ inputs.branch }}"

- name: Install kubectl and Helm
uses: azure/setup-kubectl@3e0aec4d80787158d308d7b364cb1b702e7feb7f #v4.0.0
Expand All @@ -50,5 +66,5 @@ jobs:
--namespace spsh \
--kubeconfig /home/runner/.kube/config \
--set branch="${{ inputs.branch }}" \
${{ inputs.branch != 'main' && format('--set imageTag="{0}"', 'DBP-1012') || '--set imageTag="latest"' }} \
${{ inputs.branch != 'main' && format('--set imageTag="{0}"', needs.branch_meta.outputs.ticket ) || '--set imageTag="latest"' }} \
--wait
2 changes: 1 addition & 1 deletion .github/workflows/publish-image-on-push-to-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ jobs:
image_name: "schulportal-load-tests"
run_trivy_scan: true
image_tag_generation: "ticket_from_branch"
add_latest_tag: true
add_latest_tag: false
container_registry: "ghcr.io"

0 comments on commit 2e8c66c

Please sign in to comment.