feat: source .env if exists

This commit is contained in:
ange 2024-05-19 13:42:29 +02:00
parent 17b82e6a91
commit 61b0a93920
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D

View File

@ -1,5 +1,7 @@
#!/bin/sh -ex
. ./.env || true
cat <<EOF > /kaniko/.docker/config.json
{
"auths": {
@ -11,9 +13,13 @@ cat <<EOF > /kaniko/.docker/config.json
}
EOF
REGISTRY="$(echo "$GITHUB_SERVER_URL" | sed 's .*:// ')"
if [ -z "$IMAGEAPP" ]; then
REGISTRY="$(echo "$GITHUB_SERVER_URL" | sed 's .*:// ')"
IMAGEAPP="$REGISTRY/$INPUT_IMAGE"
fi
/kaniko/executor \
--cache=true \
--context "${INPUT_DOCKERFILE%/*}" \
--dockerfile "$INPUT_DOCKERFILE" \
--destination "$REGISTRY/$INPUT_IMAGE"
--destination "$IMAGEAPP"