LoginSignup
8
5

More than 5 years have passed since last update.

Embulkにdotenvで設定した環境変数を使う

Posted at

環境変数記述 (.env)

.env

EMBULK_PATH_PREFIX=xxx.csv

Embulk 設定ファイル (yml.liquid)

test.yml.liquid

in:
  type: file
  path_prefix: {{ env.EMBULK_PATH_PREFIX }}  # ← ここで参照
  parser:
    charset: UTF-8
    newline: CRLF
    type: csv
    delimiter: ','
    columns:
    - {name: id, type: long}
    - {name: name, type: string}
out:
  type: stdout

実行ファイル

embulk_run.sh

export $(cat .env | xargs)
embulk run test.yml.liquid

実行

$ ./embulk_run.sh
8
5
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
8
5