feat: branch in ns
This commit is contained in:
parent
c4929e5dad
commit
89b95a5437
@ -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 }}
|
||||
|
11
k8sdeploy.sh
11
k8sdeploy.sh
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user