How to call circleCI environment variable in an Angular 2+ project?

后端 未结 2 567
清歌不尽
清歌不尽 2021-01-16 07:56

I have an angular project that has an api-keys.ts file that looks like this:

export var masterFirebaseConfig = {apiKey: $fireBaseApiKey, authDomain: \'dataJi         


        
2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-16 08:25

    Have you tried echo $fireBaseApiKey (without quotes)?

    To troubleshoot CircleCI, it's useful to launch an image locally.

    Example: the command below will launch a local ubuntu instance with an environment variable fireBaseApiKey set to asdf-asdf-asdf. Your local files will be mounted in /usr/src/app.

    docker run -it -e fireBaseApiKey=asdf-asdf-asdf -v $PWD:/usr/src/app ubuntu bash
    

    To check your environment variable, try:

    echo $fireBaseApiKey
    

    cd /usr/src/app and run your build script, step by step. I find it useful to troubleshoot builds failing for unknown reasons.

提交回复
热议问题