LoginSignup
3
3

More than 5 years have passed since last update.

Berkshelf3 | berks init

Posted at

Berkshelf3 | berks init

概要

berks init コマンドは下記のファイル群のテンプレートを生成します。

  • Berksfile
  • Thorfile
  • chefignore
  • .gitignore
  • Gemfile
  • Vagrantfile

前提

berks init を実行するには、事前に metadata.rb
作成しておく必要があります。

参考手順

# 事前に knife solo で kitchen を作っておきます
$ knife solo init hoge
$ cd hoge

# 事前に metadata.rb を作成しておきます

$ cat <<EOS>metadata.rb
> name             'hoge'
> maintainer       'tbpgr'
> maintainer_email 'sample'
> license          'All rights reserved'
> description      'Installs/Configures createdb'
> long_description 'long_description'
> version          '0.1.0'
>
> depends          'git'
> EOS

# init
$ berks init
    conflict  Berksfile
    Overwrite /some_path/hoge/Berksfile? (enter "h" for help) [Ynaqdh] n
        skip  Berksfile
      create  Thorfile
      create  chefignore
    conflict  .gitignore
Overwrite /some_path/hoge/.gitignore? (enter "h" for help) [Ynaqdh] n
        skip  .gitignore
      create  Gemfile
      create  Vagrantfile
Successfully initialized

# ※出力済みファイルについては、 overwrite するどうか選択する

# 出力ファイル、フォルダを確認する

$ tree
.
┣ Berksfile
┣ chefignore
┣ cookbooks
┣ data_bags
┣ environments
┣ Gemfile
┣ metadata.rb
┣ nodes
┣ README.md
┣ roles
┣ site-cookbooks
┣ Thorfile
┗ Vagrantfile

公式リファレンス

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