kaniko/entrypoint.sh

29 lines
544 B
Bash
Raw Permalink Normal View History

2024-05-02 15:10:52 +00:00
#!/bin/sh -ex
2024-11-29 05:58:07 +00:00
#shellcheck disable=SC1091
cd "./${INPUT_DOCKERFILE%/*}"
2024-04-28 21:16:33 +00:00
2024-08-17 16:16:49 +00:00
[ -f .env ] && . ./.env
2024-05-19 11:42:29 +00:00
2024-05-02 15:10:52 +00:00
cat <<EOF > /kaniko/.docker/config.json
2024-04-28 21:16:33 +00:00
{
"auths": {
2024-05-02 15:10:52 +00:00
"$GITHUB_SERVER_URL": {
"username": "$INPUT_USERNAME",
"password": "$INPUT_PASSWORD"
2024-04-28 21:16:33 +00:00
}
}
}
EOF
2024-11-14 14:58:18 +00:00
if [ -z "$IMAGEAPP" ]; then
REGISTRY="$(echo "$GITHUB_SERVER_URL" | sed 's .*:// ')"
2024-11-29 04:34:56 +00:00
IMAGEAPP="$REGISTRY/$INPUT_IMAGE"
2024-11-14 14:58:18 +00:00
fi
2024-05-19 11:42:29 +00:00
2024-05-02 15:10:52 +00:00
/kaniko/executor \
2024-11-29 04:24:27 +00:00
--cache="$INPUT_CACHE" \
2024-11-29 06:03:49 +00:00
--context . \
--destination "$IMAGEAPP" \
--dockerfile "${INPUT_DOCKERFILE##*/}"