From dd103cf3b7bab5ded27171858f3f549627cb74bd Mon Sep 17 00:00:00 2001 From: ange Date: Fri, 29 Nov 2024 05:05:59 +0000 Subject: [PATCH] test --- entrypoint.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 7396119..52fdd74 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,12 +1,15 @@ #!/bin/bash -e # shellcheck disable=SC1091 +pwd set -a . ./.env set +a -REGISTRY="${IMAGEAPP%%/*}" -export K8S_NS; K8S_NS="$(printf '%s' "${GITHUB_REPOSITORY#*/}-$GITHUB_REF_NAME" | tr '[:upper:]' '[:lower:]' | tr -c '[:lower:][:digit:]-' - | sed 's/-\+/-/g; s/^-\+//; s/-$//')" +export K8S_NS; +K8S_NS="$(printf '%s' "${GITHUB_REPOSITORY#*/}-$GITHUB_REF_NAME" \ + | tr '[:upper:]' '[:lower:]' | tr -c '[:lower:][:digit:]-' - \ + | sed 's/-\+/-/g; s/^-\+//; s/-$//')" mkdir -p "$HOME/.kube/" echo "$INPUT_KUBECONFIG" > "$HOME/.kube/config" @@ -16,7 +19,7 @@ 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-server="${IMAGEAPP%%/*}" \ --docker-username="$INPUT_REGISTRY_USERNAME" \ --docker-password="$INPUT_REGISTRY_PASSWORD" fi