2024-05-02 15:10:52 +00:00
|
|
|
#!/bin/sh -ex
|
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:24:27 +00:00
|
|
|
printf '%s' "$INPUT_IMAGE"
|
|
|
|
printf '%s' "$INPUT_IMAGE" | tr '[:upper:]' '[:lower:]' | tr -c '[:lower:][:digit:]-/:_' _
|
|
|
|
printf '%s' "$INPUT_IMAGE" | tr '[:upper:]' '[:lower:]' | tr -c '[:lower:][:digit:]-:_' _
|
2024-11-28 03:58:54 +00:00
|
|
|
IMAGEAPP="$REGISTRY/$(printf '%s' "$INPUT_IMAGE" | tr '[:upper:]' '[:lower:]' | tr -c '[:lower:][:digit:]-/:_' _)"
|
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-05-02 15:10:52 +00:00
|
|
|
--context "${INPUT_DOCKERFILE%/*}" \
|
|
|
|
--dockerfile "$INPUT_DOCKERFILE" \
|
2024-05-19 11:42:29 +00:00
|
|
|
--destination "$IMAGEAPP"
|