Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Separate development and deployment git repositories

Tags:

git

deployment

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 ?

like image 920
Shaggy Avatar asked May 21 '14 04:05

Shaggy


1 Answers

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)

like image 78
VonC Avatar answered Oct 10 '22 12:10

VonC