Artifacts Filename Cannot Be Set with Dynamic Variables
Since merge request !113 (merged) it is possible to define artifact names even with variables like that:
build:
stage: build
script:
- ./someBuildScript
artifacts:
name: "MyName_$CI_BUILD_ID"
paths:
- some/artifacts/*.jar
The script above results in an artifacts file like that: MyName_123.zip
But it is not possible to use dynamically created environment variables like that:
before_script:
- export MY_ENV=SomeVal
build:
stage: build
script:
- ./someBuildScript
artifacts:
name: "MyName_$MY_ENV"
paths:
- some/artifacts/*.jar
The script above results in an artifacts file like that: MyName_.zip but desired is MyName_SomeVal.zip.
Why is this desired?
Currently there is no way to provide the artifacts archive name with custom information, except those things that are already available by predefined CI variables or global static variables. In my case I would like to add the project version of my gradle project. I don't want to maintain the version in two files because this is error prone.
Others might want the current time stamp in the name or something else.
Versions
- gitlab-ci-multi-runner => 1.5.2
- GitLab 8.10.6
Proposal
We have 2 options that needs to be evaluated before taking a decision.
- Send YAML-defined variables to Runner
- Expand
artifacts:name
in the GitLab side and send it to Runner