Deploy a website using git in Ubuntu
kramerapps.com
kramerapps.com
Just have your script export the repo contents by using `git archive` —thereby exporting just the files you created, without any git machinery—instead of this approach.
The server need not even be set up git over http (via git-update-server-info or what have you) for this to be an issue.
My next step is deploying to a temporary folder and swapping symlinks around, but if git/hg can do an atomic update that would be much simpler.
There's no way git checkout can be atomic.
My apologies if this is too off-topic, but it's interesting to see everyone's virtualenv setup. I normally have my project/site/app in my environment folder, so it looks something like:
projectenv/
bin/
include/
lib/
project/
but I've also seen (as is the case in the OP's example): project/
env/
__init__.py
database.py
...
or even having a separate folder for all environments: envs/
env1/
env2/
...
project1/
...
project2/
...
Would anyone say there's a "preferred" setup?I think everyone knows how to use a package manager and find the equivalents for 'apt-get install'
1) automatically pull changes into the deployment repository from the bare repository
2) automatically push changes into the bare repository from the deployment repository
feels like a hack. Maybe git needs a concept somewhere between a normal and a bare repository, where the files are checked out but aren't teated like a normal work tree, i.e. you can't commit anything, and on a merge any local changes are thrown out?
In the comments there's also a nice set up for running a staging server from the same hub repo.
what if the "bare" git repo (/srv/git/helloworld.git) belongs to a user "git" and the non-bare setup (/srv/www/helloworld) belongs to use "conradev" ? this (different users) setup is what one would prefer when multiple people are working on the project.
git pull hub master would fail in that case as it would be executed by the git user. so you'll probably have a lot of hard time figuring out permissions. what are your suggestions now ?
So, we need to keep things simpler!
I think that introducing users to ACLs, permissions and security is appropriate at this step. You can have a script/process in place that can take care of this but you should explain what's going on and why. Because if there's a security issue, they can at least have some kind idea of what happened.