mirror of
https://github.com/aevea/action-kaniko.git
synced 2025-05-05 15:28:15 +02:00
add support for skaffold build args
This commit is contained in:
parent
dcbacefa08
commit
a8280d2cc5
2 changed files with 6 additions and 2 deletions
|
@ -9,6 +9,8 @@ image filesystem.
|
|||
This allows for a quite efficient caching, that can be pushed to another docker registry and downloaded on-demand, and a noticeably easier and
|
||||
more secure secret passing to the build context, as it happens in the user space itself.
|
||||
|
||||
**Note**: skaffold buildArgs that use golang template syntax are **not** supported.
|
||||
|
||||
## Usage
|
||||
|
||||
## Example pipeline
|
||||
|
|
|
@ -75,8 +75,10 @@ do
|
|||
INPUT_IMAGE=$(trim ${INPUT_IMAGE})
|
||||
INPUT_TAG=$(trim ${INPUT_TAG})
|
||||
INPUT_DOCKERFILE=$(trim ${INPUT_DOCKERFILE})
|
||||
SKAFFOLD_BUILD_ARGS=$(yq eval '.images[] | select(.imageName = env(INPUT_IMAGE)) | .docker.buildArgs[] | key + "=" + . | "--build-arg " + .' ais-build.yaml | tr '\n' ' ')
|
||||
|
||||
echo "Processing: context: [${INPUT_PATH}] image: [${INPUT_IMAGE}] tag: [${INPUT_TAG}] dockerfile: [${INPUT_DOCKERFILE}]"
|
||||
|
||||
echo "Processing: context: [${INPUT_PATH}] image: [${INPUT_IMAGE}] tag: [${INPUT_TAG}] dockerfile: [${INPUT_DOCKERFILE}] skaffold buildArgs: [${SKAFFOLD_BUILD_ARGS}]"
|
||||
|
||||
export IMAGE=${INPUT_IMAGE}
|
||||
export TAG=${INPUT_TAG:-$([ "$BRANCH" == "master" ] && echo latest || echo $BRANCH)}
|
||||
|
@ -128,7 +130,7 @@ do
|
|||
fi
|
||||
fi
|
||||
|
||||
export ARGS="$CACHE $CONTEXT $DOCKERFILE $TARGET $DESTINATION $INPUT_EXTRA_ARGS"
|
||||
export ARGS="$CACHE $CONTEXT $DOCKERFILE $TARGET $DESTINATION $INPUT_EXTRA_ARGS ${SKAFFOLD_BUILD_ARGS}"
|
||||
|
||||
cat <<EOF >/kaniko/.docker/config.json
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue