feat: branch in ns

This commit is contained in:
ange 2024-04-30 23:34:03 +02:00
parent c4929e5dad
commit 89b95a5437
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
2 changed files with 7 additions and 5 deletions

View File

@ -15,6 +15,7 @@ runs:
run: ${{ gitea.action_path }}/k8sdeploy.sh
env:
ACTION_REPO: ${{ gitea.repository }}
ACTION_REF_NAME: ${{ gitea.ref_name }}
ACTION_KUBECONFIG: ${{ inputs.kubeconfig }}
ACTION_REGISTRY_USERNAME: ${{ inputs.registry_username }}
ACTION_REGISTRY_PASSWORD: ${{ inputs.registry_password }}

View File

@ -6,7 +6,7 @@ set -a
set +a
REGISTRY="${IMAGEAPP%%/*}"
NS="${ACTION_REPO#*/}"
NS="${ACTION_REPO#*/}-${ACTION_REFNAME}"
mkdir -p "$HOME/.kube/"
echo "$ACTION_KUBECONFIG" > "$HOME/.kube/config"
@ -14,10 +14,11 @@ kubectl get namespace "$NS" || kubectl create namespace "$NS"
kubectl config set-context --current --namespace="$NS"
if [ -n "$ACTION_REGISTRY_PASSWORD" ]; then
kubectl create secret docker-registry regcred \
--docker-server="$REGISTRY" \
--docker-username="$ACTION_REGISTRY_USERNAME" \
--docker-password="$ACTION_REGISTRY_PASSWORD"
kubectl get secret regcred \
|| kubectl create secret docker-registry regcred \
--docker-server="$REGISTRY" \
--docker-username="$ACTION_REGISTRY_USERNAME" \
--docker-password="$ACTION_REGISTRY_PASSWORD"
fi
./manifests/bin/devel.sh