I have a job which needs to include another job and needs to append a value to a variable, such as:
nightlies:
variables:
BUILD_NAME: "nightly"
script:
- $BUILD_NAME="${BUILD_NAME}-$(date +"%Y%m%d")"
only:
- schedules
trigger:
include:
- local: /.gitlab-ci/build.yml
strategy: depend
However reading the documentation script
and trigger
cannot be used together and I'm unsure of how else to create the BUILD_NAME
with a date. Is there a way to use both. Otherwise, is there a way I could remove the trigger in order to use script, which would still call that job?
before_script
, in the root of the file, but it seems that the variable made there cannot be exported and I have no idea how else to make it accessible to theBUILD_NAME
variable