I would like to pass a dotenv variable to a downstream pipeline. The variable is “created” during build, because the version is extracted from a source file.
prepare-build: stage: prepare_build script: - export VERSION=$(cat package.json | jq -r .version) - echo "VERSION=$VERSION" >> build.env artifacts: reports: dotenv: build.env
In the next build steps the variable VERSION is available and contains the correct version value. Everything is fine so far.
But in the last step I want to pass this variable to a downstream pipeline:
trigger-deployment: stage: trigger_deploy variables: VERSION: $VERSION trigger: project: my/project
This doesn’t work. The variable VERSION contains the string $VERSION, not the actual version number as in all build steps before.
Is it not possible to pass dotenv variables to downstream pipelines? If not, is there any other way to do it?
Thanks for your help.