代码之家  ›  专栏  ›  技术社区  ›  hlesnt395

从Chef克隆git存储库

  •  0
  • hlesnt395  · 技术社区  · 7 年前

    我在网上发现,我们可以从以下chef资源块克隆git存储库。

    git "/path/to/check/out/to" do
      repository "git://github.com/opscode/chef.git"
      reference "master"
      action :sync
    end
    

    2 回复  |  直到 7 年前
        1
  •  0
  •   DominikAngerer    7 年前

    查看厨师的文档,您可以添加 ssh_wrapper 此的参数 https://docs.chef.io/resource_git.html

    可能的

    你的 ssh\u包装

    ssh_wrapper "ssh -i /some/path/id_rsa"
    

    所有参数

    git 'name' do
      additional_remotes         Hash
      checkout_branch            String
      depth                      Integer
      destination                String # defaults to 'name' if not specified
      enable_checkout            TrueClass, FalseClass
      enable_submodules          TrueClass, FalseClass
      environment                Hash
      group                      String, Integer
      notifies                   # see description
      provider                   Chef::Provider::Scm::Git
      reference                  String
      remote                     String
      repository                 String
      revision                   String
      ssh_wrapper                String
      subscribes                 # see description
      timeout                    Integer
      user                       String, Integer
      action                     Symbol # defaults to :sync if not specified
    end
    
        2
  •  0
  •   coderanger    7 年前

    如果要使用SSH密钥作为凭据,请查看 poise_git cookbook and resource