k8sdeploy/k8sdeploy.sh
2024-04-30 23:18:19 +02:00

24 lines
583 B
Bash
Executable File

#!/bin/bash -e
# shellcheck disable=SC1091
set -a
. ./.env
set +a
REGISTRY="${IMAGEAPP%%/*}"
NS="${ACTION_REPO#*/}"
mkdir -p "$HOME/.kube/"
echo "$ACTION_KUBECONFIG" > "$HOME/.kube/config"
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"
fi
./manifests/bin/devel.sh