kaniko/build.sh

26 lines
496 B
Bash
Raw Normal View History

2024-05-02 15:10:52 +00:00
#!/bin/sh -ex
2024-04-28 21:16:33 +00:00
2024-08-17 16:13:48 +00:00
[ -f .env ] && source .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-05-19 11:42:29 +00:00
if [ -z "$IMAGEAPP" ]; then
REGISTRY="$(echo "$GITHUB_SERVER_URL" | sed 's .*:// ')"
IMAGEAPP="$REGISTRY/$INPUT_IMAGE"
fi
2024-05-02 15:10:52 +00:00
/kaniko/executor \
--cache=true \
--context "${INPUT_DOCKERFILE%/*}" \
--dockerfile "$INPUT_DOCKERFILE" \
2024-05-19 11:42:29 +00:00
--destination "$IMAGEAPP"