Shaggy
Shaggy

Reputation: 233

Separate development and deployment git repositories

I recently came across an approach of managing a project and its deliverable. Project team was using git repository for development. There was another repository being used for deploying artifacts. I can see several benefits with this approach.

  1. Keep the deployment history clean ( No developer commits )
  2. Limited access to deployment repository ( No developer can push to master and break things as they do not have access to the deployment repository )
  3. All the dependencies are in the deployment repository. This reduces the risk of running bower install or similar dependency managers at different stages of deployment and getting different results.

What are the benefits and disadvantages of this approach in your opinion ?

Upvotes: 8

Views: 2614

Answers (1)

VonC
VonC

Reputation: 1328712

The main benefit is to keep deliverable artifacts (which can be large and can include binaries) separate from the source repo.

  • the main repo remains a source-only repo (meaning text content, no -- or few and small -- binaries)
  • the delivery repo:
    • is managed independently,
    • doesn't have to be cloned completely (a shallow clone can be enough, since that feature has been improved recently)
    • can be "cleanup" if necessary (trimming old deliveries now obsolete)

The main inconvenient (for both approaches) is to keep binaries in a git repo (which isn't a good fit for such artifacts).
Alternatives exist (using git): git-annex, bup, ....
Or you can store those deliverable in a dedicated referential, like Nexus (which is different from a git repo)

Upvotes: 6

Related Questions