如何使用saltstack从私有存储库自动执行git pull操作?

时间:2016-10-19 07:02:40

标签: digital-ocean salt-stack

我正在使用数字海洋Ubuntu服务器进行托管。我想在我的salt-master和minions上自动执行git pull操作。

1 个答案:

答案 0 :(得分:1)

我在状态文件中使用它来克隆Git存储库。您可以在需要时自动执行状态:

# Place a Git deploy key.
/root/.ssh/id_rsa:
  file.managed:
    - source: salt://files/id_rsa
    - user: user
    - group: group
    - mode: 600
    - template: jinja

# Clone the repository.
git@github.com:user/repository.git:
  git.latest:
    - user: user
    - identity: /root/.ssh/id_rsa
    - target: /folder/to/clone/to/
    - branch: master
    - require:
      - file: /root/.ssh/id_rsa