Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dbp 593 fix manual deployment #11

Merged
merged 4 commits into from
Feb 9, 2024
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
10 changes: 6 additions & 4 deletions .github/workflows/deploy-to-dev-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ jobs:
- create_branch_identifier
runs-on: ubuntu-latest
steps:
- name: Check if namespace is allowed, fails if it not starts with ticketnr, e.g. spsh-1234
- name: Check if namespace is allowed, fails if it not starts with ticketnr, e.g. spsh-1234 or is exactly 'main'
run: |
regex='^([[:alpha:]]+?-[[:digit:]]+)'
[[ ${{ needs.create_branch_identifier.outputs.namespace_from_branch }} =~ $regex ]]
echo "${BASH_REMATCH[1]}"
if ${{ github.event.inputs.namespace != 'main' }}; then
regex='^([[:alpha:]]+?-[[:digit:]]+)'
[[ ${{ github.event.inputs.namespace }} =~ $regex ]]
echo "${BASH_REMATCH[1]}"
fi

deploy:
needs:
Expand Down
20 changes: 7 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ name: Deploy Action
on:
workflow_call:
inputs:
#branch:
# required: true
# type: string
namespace:
required: true
type: string
Expand Down Expand Up @@ -60,15 +57,10 @@ jobs:
chart_name: "dbildungscloud-iam-keycloak"
service_name: "dbildungs-iam-keycloak"

create_ingress_prefix:
uses: dBildungsplattform/spsh-app-deploy/.github/workflows/get-branch-meta.yml@main

create_lowercase_ingress_prefix:
needs:
- create_ingress_prefix
uses: dBildungsplattform/spsh-app-deploy/.github/workflows/branch-to-namespace.yml@main
with:
branch: ${{ needs.create_ingress_prefix.outputs.ticket }}
branch: ${{ inputs.namespace }}

create_keycloak_db_name:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -111,11 +103,13 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
KUBECONFIG_FILE: '${{ secrets.SPSH_DEV_KUBECONFIG }}'
steps:
- name: Check if namespace is allowed, fails if it not starts with ticketnr, e.g. spsh-1234
- name: Check if namespace is allowed, fails if it not starts with ticketnr, e.g. spsh-1234 or is exactly 'main'
run: |
regex='^([[:alpha:]]+?-[[:digit:]]+)'
[[ ${{ inputs.namespace }} =~ $regex ]]
echo "${BASH_REMATCH[1]}"
if ${{ inputs.namespace != 'main' }}; then
regex='^([[:alpha:]]+?-[[:digit:]]+)'
[[ ${{ inputs.namespace }} =~ $regex ]]
echo "${BASH_REMATCH[1]}"
fi
- name: checkout repo
uses: actions/checkout@v2
with:
Expand Down