Skip to content

Deploy Project manually into dev cluster #100

Deploy Project manually into dev cluster

Deploy Project manually into dev cluster #100

---
name: Deploy Project manually into dev cluster
on:
workflow_dispatch:
inputs:
namespace:
type: string
description: Kubernetes namespace of the deployment, has to start with ticketnr, e.g. spsh-1234
required: true
dbildungs_iam_server_branch:
required: true
description: "dbildungs_iam_server Branch. Has to be main or in format <project>-<ticketnumber>, e.g. spsh-130"
default: main
type: string
schulportal_client_branch:
required: true
description: "schulportal_client Branch. Has to be main or in format <project>-<ticketnumber>, e.g. spsh-130"
default: main
type: string
dbildungs_iam_keycloak_branch:
required: true
description: "dbildungs_iam_keycloak Branch. Has to be main or in format <project>-<ticketnumber>, e.g. spsh-130"
default: main
type: string
dbildungs_iam_ldap_branch:
required: true
description: "dbildungs_iam_ldap Branch. Has to be main or in format <project>-<ticketnumber>, e.g. spsh-130"
default: main
type: string
dbseeding:
required: true
description: "DB-Seeding (Default: chart_value)"
default: "chart_value"
type: choice
options:
- "chart_value"
- "true"
- "false"
database_deletion:
required: true
description: "Delete Databases? Yes = true; No = false;"
default: "false"
type: choice
options:
- "true"
- "false"
jobs:
create_branch_identifier:
uses: dBildungsplattform/spsh-app-deploy/.github/workflows/deploy-branch-to-namespace.yml@2
with:
branch: ${{ github.event.inputs.namespace }}
check_namespace_input:
needs:
- 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 or is exactly 'main'
run: |
if ${{ github.event.inputs.namespace != 'main' }}; then
regex='^([[:alpha:]]+?-[[:digit:]]+)'
[[ ${{ github.event.inputs.namespace }} =~ $regex ]]
echo "${BASH_REMATCH[1]}"
fi
deploy:
needs:
- check_namespace_input
- create_branch_identifier
uses: dBildungsplattform/spsh-app-deploy/.github/workflows/deploy.yml@DBP-1084-rollout-to-namespaces-do-not-delete-dbs
with:
dbildungs_iam_server_branch: ${{ github.event.inputs.dbildungs_iam_server_branch }}
schulportal_client_branch: ${{ github.event.inputs.schulportal_client_branch }}
dbildungs_iam_keycloak_branch: ${{ github.event.inputs.dbildungs_iam_keycloak_branch }}
dbildungs_iam_ldap_branch: ${{ github.event.inputs.dbildungs_iam_ldap_branch }}
dbseeding: ${{ github.event.inputs.dbseeding }}
namespace: ${{ needs.create_branch_identifier.outputs.namespace_from_branch }}
user_name: spsh-bot
secrets:
SPSH_DEV_KUBECONFIG: ${{ secrets.SPSH_DEV_KUBECONFIG }}
deploy-successful:
needs:
- deploy
runs-on: ubuntu-latest
steps:
- run: echo "Deployment workflow was successful"