Hi,
My project needs a different config.json depending on the branch it is in, I build on the protected branches master, acc and prod. So I made variables of type “File” for each branch (MASTER_CONFIG, ACC_CONFIG, PROD_CONFIG) with each their own content. But how do I make the ci build get this data and copy it to the right location? I tried copying the values before building, but it doesn’t seem to work like this. What is the correct way? My gitlab-ci for the config stage looks something like this:
master_conf:
image: docker:stable
stage: config
only:
- master
script:
- cp $MASTER_CONFIG config.json
artifacts:
paths:
- config.js
test_conf:
image: docker:stable
stage: config
only:
- acc
script:
- cp $ACC_CONFIG config.json
artifacts:
paths:
- config.js
prod_conf:
image: docker:stable
stage: config
only:
- prod
script:
- cp $PROD_CONFIG config.json
artifacts:
paths:
- config.js
The logging seems to show that cp gets the content of the file instead of the file path as parameters.