fix: invalid namespace name
This commit is contained in:
parent
84ec9cf196
commit
860ab947e4
2 changed files with 2 additions and 2 deletions
28
entrypoint.sh
Executable file
28
entrypoint.sh
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/bash -e
|
||||
# shellcheck disable=SC1091
|
||||
|
||||
set -a
|
||||
. ./.env
|
||||
set +a
|
||||
|
||||
REGISTRY="${IMAGEAPP%%/*}"
|
||||
export K8S_NS; K8S_NS="$(tr '[:upper:]' '[:lower:]' <<< "${GITHUB_REPOSITORY#*/}-$GITHUB_REF_NAME" | tr -c '[:lower:]-' -)"
|
||||
|
||||
mkdir -p "$HOME/.kube/"
|
||||
echo "$INPUT_KUBECONFIG" > "$HOME/.kube/config"
|
||||
kubectl get namespace "$K8S_NS" || kubectl create namespace "$K8S_NS"
|
||||
kubectl config set-context --current --namespace="$K8S_NS"
|
||||
|
||||
if [ -n "$INPUT_REGISTRY_PASSWORD" ]; then
|
||||
kubectl get secret regcred \
|
||||
|| kubectl create secret docker-registry regcred \
|
||||
--docker-server="$REGISTRY" \
|
||||
--docker-username="$INPUT_REGISTRY_USERNAME" \
|
||||
--docker-password="$INPUT_REGISTRY_PASSWORD"
|
||||
fi
|
||||
|
||||
if [ "$GITHUB_REF_NAME" = prod ] || [ "$GITHUB_REF_NAME" = staging ]; then
|
||||
./manifests/bin/prod.sh
|
||||
else
|
||||
./manifests/bin/devel.sh
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue