Managing code repositories with Git

In modern dynamic environments, usage of code repositories is considered vital for efficient code management, collaboration, and practices such as Continuous Integration. Fortunately, Salt makes it easy enough to manage code repositories using its modules. In this recipe, you will learn how to manage code repositories using Git.

How to do it...

We will use the same minion and state directory as the previous recipe:

  1. Create and edit the /opt/salt-cookbook/staging/apache/git_repo.sls file to have the following entries:
    git: pkg: - installed user: - present - home: /home/git /opt/apache-repo: file.directory: - user: git - group: git - dir_mode: 0755 - require: - user: git /home/git/.ssh: file.directory: - user: git ...

Get Salt Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.