vendor/chef/chef-deploy/lib/chef-deploy/git.rb
# Performs a clone on the remote machine, then checkout on the branch
# you want to deploy.
Performs a clone on the remote machine, then checkout on the branch
you want to deploy.
Performs a clone on the remote machine then checkout on the branch you want to deploy .
def checkout(revision, destination)
    remote = origin
    args = []
    args << "-o #{remote}" unless remote == 'origin'
    if depth = configuration[:git_shallow_clone]
      args << "--depth #{depth}"
    end
    execute = []
    if args.empty?
      execute << "#{git} clone #{verbose} #{configuration[:repository]} #{destination}"
    else
      execute << "#{git} clone #{verbose} #{args.join(' ')} #{configuration[:repository]} #{destination}"
    end
    execute << "cd #{destination} && #{git} checkout #{verbose} -b deploy #{revision}"
    if configuration[:git_enable_submodules]
      execute << "#{git} submodule #{verbose} init"
      execute << "#{git} submodule #{verbose} update"
    end
    execute.join(" && ")
  end
def checkout ( revision , destination ) remote = origin args = [ ] args << "-o #{remote}" unless remote == 'origin' if depth = configuration [ :git_shallow_clone ] args << "--depth #{depth}" end execute = [ ] if args . empty? execute << "#{git} clone #{verbose} #{configuration[:repository]} #{destination}" else execute << "#{git} clone #{verbose} #{args.join(' ')} #{configuration[:repository]} #{destination}" end execute << "cd #{destination} && #{git} checkout #{verbose} -b deploy #{revision}" if configuration [ :git_enable_submodules ] execute << "#{git} submodule #{verbose} init" execute << "#{git} submodule #{verbose} update" end execute . join ( " && " ) end
Performs a clone on the remote machine, then checkout on the branch
you want to deploy.
Performs a clone on the remote machine then checkout on the branch you want to deploy .
# checkout into a local branch rather than a detached HEAD
revision
destination