k8sdeploy/k8sdeploy.sh

24 lines
583 B
Bash
Raw Normal View History

2024-04-30 21:08:27 +00:00
#!/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"
2024-04-30 21:18:19 +00:00
if [ -n "$ACTION_REGISTRY_PASSWORD" ]; then
2024-04-30 21:08:27 +00:00
kubectl create secret docker-registry regcred \
--docker-server="$REGISTRY" \
2024-04-30 21:18:19 +00:00
--docker-username="$ACTION_REGISTRY_USERNAME" \
--docker-password="$ACTION_REGISTRY_PASSWORD"
2024-04-30 21:08:27 +00:00
fi
./manifests/bin/devel.sh