test
This commit is contained in:
parent
c92462e209
commit
dd103cf3b7
@ -1,12 +1,15 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
|
|
||||||
|
pwd
|
||||||
set -a
|
set -a
|
||||||
. ./.env
|
. ./.env
|
||||||
set +a
|
set +a
|
||||||
|
|
||||||
REGISTRY="${IMAGEAPP%%/*}"
|
export K8S_NS;
|
||||||
export K8S_NS; K8S_NS="$(printf '%s' "${GITHUB_REPOSITORY#*/}-$GITHUB_REF_NAME" | tr '[:upper:]' '[:lower:]' | tr -c '[:lower:][:digit:]-' - | sed 's/-\+/-/g; s/^-\+//; s/-$//')"
|
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/"
|
mkdir -p "$HOME/.kube/"
|
||||||
echo "$INPUT_KUBECONFIG" > "$HOME/.kube/config"
|
echo "$INPUT_KUBECONFIG" > "$HOME/.kube/config"
|
||||||
@ -16,7 +19,7 @@ kubectl config set-context --current --namespace="$K8S_NS"
|
|||||||
if [ -n "$INPUT_REGISTRY_PASSWORD" ]; then
|
if [ -n "$INPUT_REGISTRY_PASSWORD" ]; then
|
||||||
kubectl get secret regcred \
|
kubectl get secret regcred \
|
||||||
|| kubectl create secret docker-registry regcred \
|
|| kubectl create secret docker-registry regcred \
|
||||||
--docker-server="$REGISTRY" \
|
--docker-server="${IMAGEAPP%%/*}" \
|
||||||
--docker-username="$INPUT_REGISTRY_USERNAME" \
|
--docker-username="$INPUT_REGISTRY_USERNAME" \
|
||||||
--docker-password="$INPUT_REGISTRY_PASSWORD"
|
--docker-password="$INPUT_REGISTRY_PASSWORD"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user