Gitlab autodevops and Kubernetes, add the configuration file for angular on review pod

133 Views Asked by At

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.

0

There are 0 best solutions below