CircleCI
references というディレクティブを追加するプラクティスがある
https://qiita.com/kyokomi/items/b10b9f1ef1707d30ae9a#アンカーをマージ
モノレポなどで、変更されたファイルに応じて workflow を変えたい場合
https://circleci.com/docs/2.0/configuration-cookbook/#execute-specific-workflows-or-steps-based-on-which-files-are-modified
Dynamic config
CircleCI Configuration Cookbook - CircleCI
ローカルでの動作確認には cli
https://circleci.com/docs/2.0/local-cli/
code:termina
circleci config validate
Local test
Using the CircleCI Local CLI - CircleCI
code:terminal
circleci config process .circleci/config.yml > process.yml
circleci local execute -c process.yml --job JOB_NAME
job に parameter がある場合は、Workflow で指定されたものが使われる感じ?
環境変数
コマンドのヘルプに使い方あり
circleci local execute -h
Job
default working directory is /project
https://circleci.com/docs/ja/2.0/configuration-reference/#job_name
コマンド実行ディレクトリ
job レベル と run?command? レベルがあるっぽい
【CircleCI】working_directoryの挙動を実験して確かめてみた|Webエンジニア研究室
cache
Caching Dependencies - CircleCI
Slack orb
custom message
https://github.com/CircleCI-Public/slack-orb/issues/76
値を使い回す
code:config.yaml
echo "export VARIABLE='string'" >> $BASH_ENV
Debug via ssh
Debugging with SSH - CircleCI
GitHub にあげている key に対応する privkey ファイルを指定すれば ok