3
2

More than 5 years have passed since last update.

CircleCI で Environment Variables に改行を含める方法

Last updated at Posted at 2015-01-15

問題

CircleCI の Environment Variables に改行を含めたい。

解決策

以下のように指定する。

$(printf 'line: 1\nline: 2')

Name: HOGE
Value: $(printf 'line: 1\nline: 2')
circle.yml:

# ...
dependencies:
  pre:
    - echo "$HOGE"
# ...

結果

$ echo "$HOGE"

line: 1
line: 2

補足

printf 'xxx\nyyy'

のかわりに

echo -e 'xxx\nyyy'

も利用可能。

-e を指定しない場合は、 \n が改行として解釈されないので注意が必要。

3
2
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
3
2