1

I have an angular project that I try to review using gitlab-ci autodevops feature in a Kubernetes cluster.
The application runs fine in the review step. But to customize the backend, I need to put a file in the assets/config folder at runtime. The content of the file should be a CI/CD variable of gitlab.

I tried this with my .gitlab-ci.yml but the file is not sent to the running pod, and the angular application uses the default value of the api

include:
  - template: Auto-DevOps.gitlab-ci.yml

review:
  before_script:
    - mkdir -p ./src/assets/config && echo "$CONFIG_JSON" > ./src/assets/config/config.json

with CONFIG_JSON value as

{
    "api" : "http://<API IP>:9090"
}

What am I missing for my file to be available in the review pod ?

Background: I'm new to Gitlab, Kubernetes and Helm.

Nicolas
  • 186
  • 2
  • 10
  • Well, what behavior **are** you experiencing? And be aware that since angular is a JS framework, 127.0.0.1 will be the user's computer, not the angular webapp's Pod – mdaniel Feb 18 '21 at 20:31
  • @mdaniel This was a template to hide the real IP. The angular app uses the default IP and not the one I try to put in the config.json. I'll change the IP to not mislead – Nicolas Feb 19 '21 at 08:14

0 Answers0