LoginSignup
8
8

More than 5 years have passed since last update.

Sigil - コマンドラインベースのテンプレートエンジン

Last updated at Posted at 2016-03-19

Sigil

環境変数を元に設定ファイルを展開してくれるツールないかなと思って調べてて見つけた。
Docker で使うなら Entrykit も便利(Entrykit 内で Sigil を使ってる)。

インストール
 ダウンロードする
 解凍する
 パスの通った場所に置く

使い方
 export WORKER_PROCESSES=123
 sigil -p -f nginx.conf.tmpl > nginx.conf

テンプレートの書き方
 必須
  {{ ${WORKER_PROCESSES:?} }};
 デフォルト値
  {{ ${WORKER_PROCESSES:-“default"} }};
  {{ var "DEMO" | default "demo" }}
 if 文
  export IS_OUTPUT=True
  {{ if var "IS_OUTPUT" }} a {{ end }}
  ※ if 文は値が存在するかのみ判定できます。== 演算子などは使えません

8
8
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
8