I'm in the process of setting up a deployment script. The basic process is:
- Push changes to a bare repository on the server
- Then based on new tags will create a new folder for the release.
- Use git archive to move the files into the release directory
- Runs some migrations scripts and puts it live (if all is successful).
The issue is my repository contains a submodule, which doesn't get put in the archive, and therefore doesn't get put in the release directory.
I've seen git-archive-all, but that doesn't work on a bare repository.
If its not possible, I'm considering,
- making the repository not bare, and updating the working copy, which would allow me to use git-archive-all. Or
- having a second bare repository of the submodule on the server, which I could get an archive from (would have to look into this to make sure I'm getting the right revision).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…