CI/CD components - inputs.var not transforming to value
spec:
inputs:
stage:
default: build
context:
default: "${CI_PROJECT_DIR}"
dockerfile:
default: "${CI_PROJECT_DIR}/Dockerfile"
---
build-container:
stage: $[[ inputs.stage ]]
parallel:
matrix:
- TARGET: develop
- TARGET: production
image:
name: gcr.io/kaniko-project/executor:v1.19.2-debug
entrypoint: [""]
script:
- /kaniko/executor
--cache=true
--cache-repo "${CI_REGISTRY_IMAGE}/cache"
--context "$[[ inputs.context ]]"
--dockerfile "$[[ inputs.dockerfile ]]"
--target ${TARGET}
--skip-unused-stages=true
--destination "${CI_REGISTRY_IMAGE}/${TARGET}:${CI_COMMIT_REF_SLUG}-latest"
--destination "${CI_REGISTRY_IMAGE}/${TARGET}:${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}"
include:
- component: gitlab.com/myproj/ci/docker-build@main
stages:
- build
Seems like in some cases inputs var not transforming to default value
Running with gitlab-runner 16.9.0 (656c1943)
...
$ /kaniko/executor --cache=true --cache-repo "${CI_REGISTRY_IMAGE}/cache" --context "${CI_PROJECT_DIR}" --dockerfile "$[[ inputs.dockerfile ]]" --target ${TARGET} --skip-unused-stages=true --destination "${CI_REGISTRY_IMAGE}/${TARGET}:${CI_COMMIT_REF_SLUG}-latest" --destination "${CI_REGISTRY_IMAGE}/${TARGET}:${CI_COMMIT_REF_SLUG}-${CI_COMMIT_SHORT_SHA}"
Error: error resolving dockerfile path: please provide a valid path to a Dockerfile within the build context with --dockerfile
Edited by Daniil Zobov