通过ansible剧本从git克隆特定分支 [英] clone a specific branch from git through ansible playbook

查看:454
本文介绍了通过ansible剧本从git克隆特定分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ansible部署我的应用程序.我正在使用以下命令从github克隆应用程序:

I am using ansible to deploy my app. I am cloning the app from github using the following:

- name: Deploy site files from Github repository
  sudo: yes
  git: repo=git@github.com:xyz/abc.git dest=/home/{{deploy_user}}/{{app_name}} key_file=/home/ubuntu/.ssh/id_rsa accept_hostkey=yes force=yes

我想从存储库中克隆一个特定的分支.我阅读了ansible的文档,但是找不到克隆特定分支的任何选项.它可以选择克隆版本,但不能克隆分支.

I want to clone a specific branch from the repository. I read the documentation of ansible but couldn't find any option to clone a specific branch. It has an option to clone a version but not branch.

推荐答案

来自文档:

版本

要检出哪个版本的存储库.这可以是完整的40个字符的SHA-1哈希,文字字符串HEAD,分支名称或标签名称.

What version of the repository to check out. This can be the full 40-character SHA-1 hash, the literal string HEAD, a branch name, or a tag name.

(重点是我的)

这篇关于通过ansible剧本从git克隆特定分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆