// - cache: Whether to use the cache for building containers. Defaults to true
// - dockerfile: Name of the docker file in the context directory. Defaults to Dockerfile
// - repo: Repository to publish container to. Defaults to the CONTAINER_REGISTRY environment variable
-// - version: Container version to build. Default to the value of the BRANCH_NAME variable
+// - tag: Container tag to build. Default to $BRANCH_NAME-latest
//
def call(Map args) {
def defaults = [
dockerfile: 'Dockerfile',
mirror: env.REGISTRY_MIRROR,
repo: env.CONTAINER_REGISTRY,
- version: env.BRANCH_NAME + "-latest"
+ tag: env.BRANCH_NAME + "-latest"
]
args = defaults << args
if (!args.image) {
--dockerfile ${args.dockerfile} \\
--cache=${args.cache} --cache-ttl=${args.cachettl} \\
--context \$( pwd )/${args.context} \\
- --destination ${args.repo}/${args.image}:${args.version}
+ --destination ${args.repo}/${args.image}:${args.tag}
rm -rf /kaniko/*[0-9]* && rm -rf /kaniko/Dockerfile && mkdir -p /workspace
"""
}