7

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 ?

Shaggy
  • 193
  • 1
  • 8
  • 1
    [This article](http://nvie.com/posts/a-successful-git-branching-model/) discusses a management model using a single Git repository to achieve much of the same; as for (2), you could (and should) restrict access to your deployment server by means of SSH instead. – lfk May 21 '14 at 04:41
  • 1
    Restricted access to the deployment server does not stop people from making accidental push to master ( even using --force ). The project was still using the mentioned git branching model but after the project was ready for release ( all the changes in master branch ), a snapshot of master branch was copied over to deployment repository in a new release branch and the release branch was checked out on the server. – Shaggy May 21 '14 at 04:49

1 Answers1

6

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)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks VonC. Can you think of some disadvantages as well for this approach? – Shaggy May 21 '14 at 12:46
  • Thanks for git-annex and bup. I have reached the conclusion that the solution to have different git repositories is not too bad after all. – Shaggy May 21 '14 at 14:16