I've tried now for several hours understanding how to use Git with webfaction. And even with the documentation I cannot get it to work. I have a Django app at: webapps/django_app/project_name/ I have a Git repo at: webapps/git_app/repos/my_repo.git I assume the following workflow:
Is this correct ? (New to git) Problem:
Some really newbie questions there, but hope to get some help! asked 28 Dec '10, 19:10 lordlarm |
For updating your Django (or any) application directly when you push to your git repository, I prefer the method described at: http://toroid.org/ams/git-website-howto In a nutshell, you would create a post-receive hook that looks something like:
Replacing "username" with your username, "django" with your django web application's name, and "myproject" with the django project name. You would specifically be committing the django project to git ("myproject" in this example), and not the entire /home/username/webapps/django application directory (which includes extra things such as the private apache server which runs your application). The post-receive hook to update would be the file at: /home/username/webapps/git/repos/djangorepo.git/hooks/post-receive where "username" is your username, "git" is your git application's name, and "djangorepo.git" is the name of the git repository you're using for your django project directory. You will also need to ensure that the hook is executable:
Hope that helps! answered 28 Jan '11, 22:15 ryans ♦♦ Another point of interest: You can "template-ify" your settings file. So, for example, if you have this running locally (with a different settings file), just make something like "settings_template.py" which is added to your git repository, and then add "settings.py" into your .gitignore file (and don't add "settings.py" to the repository). Now, you can instantly share the same django project between your local and remote systems without worrying about blowing away each side's respective settings files, and at the same time still be able to use the automatic update-on-push post-receive hook.
(14 Apr '11, 20:25)
ryans ♦♦
I know I am way late on this, but this topic interests me. However, I am a little confused by what you mean when you say "template-ify". What exactly would be using the settings_template.py?
(09 Oct '11, 01:08)
miningold
Nothing would be using The Now, imagine that we just add So, instead, we add UPDATE I now have changed my workflow a bit and find that the following works a bit better. I leave '
Then, define the deployment-specific options in ' This allows actual configuration options (like
(09 Oct '11, 01:29)
ryans ♦♦
Why do you add
(13 May '12, 20:35)
Rupe
I have added this so that if you delete a file in the origin git repository, it is likewise deleted in the application directory on the webfaction server. I remember that originally I had encountered an issue where under certain circumstances extra files would be left around, and performing the
(13 May '12, 20:44)
ryans ♦♦
If you're prompted for a password when pushing or pulling over SSH, you can fix that by setting up a SSH keypair to use for authentication. The steps are almost identical to those in our SSH key documentation but with one difference: both steps should be run while logged into SSH on your WebFaction server.
(06 Feb '13, 10:23)
seanf
showing 5 of 6
show 1 more comments
|
Our official documentation on GIT is here,
You should be able to simply push and pull your code using SSH. This section specifically should answer your questions with examples,
answered 28 Dec '10, 20:10 johns The foloowing link is DEAD. - [http://docs.webfaction.com/software/git.html#pushing-and-pulling-with-a-repository] It only goes to [http://docs.webfaction.com/software/git.htm] All this Git stuff needs A LOT of attention.
(11 Feb '19, 21:31)
jdor2
|
How do you include the static files in the Git repo, while having a separatie static files app? What I mean is, in my local environment I have the static files folder in my project folder like:
But on Webfaction the static folder is a separate app so nginx handles the static files. But then we have the problem that with ryans solution that an automatic gitcheckout won't work (it works, but it will create a Any ideas? answered 23 Oct '12, 15:54 Peter Just add commands to the post-commit script to copy the static files to wherever they need to be, eg:
Or, replace your static-only app with a static-only symlink app pointing to
(23 Oct '12, 16:00)
seanf
Thank you seanf, I've tried the second solution and that works great. I didn't know that it was possible to serve 2 different folders in 1 app with 2 different http servers (apache/mod_wsgi for the django files, nginx for the static files).
(23 Oct '12, 16:28)
Peter
|