LoginSignup
7
4

More than 3 years have passed since last update.

Circleciに環境変数を設定する

Last updated at Posted at 2019-06-20

AWSのクレデンシャルとか .circleci/config.ymlにハードコードしたくない物をContextを使って解決する

  1. SETTINGS → Contexts → CreateContextを押す
    image.png

  2. Contexts名を入れてエンター

  3. Add Enviroment Variableを押す
    image.png

  4. NameとValueを入れて環境変数を設定していく

  5. .circleci/config.ymlで使う

workflows:
  version: 2
  build_and_deploy:
    jobs:
      - build:
          context: [作成したcontext名]

こんな感じで使える

      - run:
          name: contextで設定した値を表示する
          command: |
            echo "${Value1}"
            echo "${Value2}"

参考

7
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
4