Live data from Hacker News

Using git to manage a website

toroid.org

11–20 of 52 posts

Re: Using git to manage a website

#11
post #8

Can I use git to manage a Drupal-managed website?

that's what we do in conjunction with http://drupal.org/project/features , bugs aside it works well but what you want in code and what you want in the DB will vary from page to page and feature to feature so often just manually redo stuff (in dev env and then again in production) because deploying changes by code is more effort then its worth.

Managing the codebase is straightforward -- that's what git's designed for. My question was more about the actual site contents, which will reside in the database. Can you use git for tracking changes to the contents?

Re: Using git to manage a website

#12
I've played with this - in the end I ended up using custom scripts and/or Capistrano scripts (along with git of course) to handle actual deployments. It provided more control and more features, while still letting me leverage git.

Re: Using git to manage a website

#13
post #5

Earlier quoted context omitted.

Why not? Were I work we use Drupal almost exclusively and use Git for everything.

Isn't the content stored in a database rather than static pages? Do you do regular commits of your database files?

if this was possible and useful drupal wouldn't have Features. the whole point is whats in the database can't be versioned easily.

Re: Using git to manage a website

#14
post #9
post #2

Is it bad, that I simply SSH into the server and do a "git pull"?

To elaborate on dolinsky and the article, if your web server is doing a "git pull", it means it has ssh access into your workstation. If someone breaks into your web server, this means that they have ssh access into your workstation as well by simply using the keys on your web server. This is bad, very bad. If you push to your web server, only your public key is exposed if your web server is compromised.

Not necessarily. If you run an ssh-agent locally and configure ForwardAgent to 'yes' for connections to your web server you can ssh to your server and use ssh from it without actually putting your private key on it.

I'd still recommend pushing to a server though.

Re: Using git to manage a website

#15
post #8

Earlier quoted context omitted.

that's what we do in conjunction with http://drupal.org/project/features , bugs aside it works well but what you want in code and what you want in the DB will vary from page to page and feature to feature so often just manually redo stuff (in dev env and then again in production) because deploying changes by code is more effort then its worth.

Managing the codebase is straightforward -- that's what git's designed for. My question was more about the actual site contents, which will reside in the database. Can you use git for tracking changes to the contents?

> Managing the codebase is straightforward

not always, often stuff is stored in the db that we want to work on in dev then deploy to production.

but it would be nice to be able to export a selection of nodes to code and preserve there id's, content and metadata. maybe you'll find a features contrib mod http://drupal.org/taxonomy/term/11478 but i've never heard of one.

Re: Using git to manage a website

#16
post #8

Earlier quoted context omitted.

that's what we do in conjunction with http://drupal.org/project/features , bugs aside it works well but what you want in code and what you want in the DB will vary from page to page and feature to feature so often just manually redo stuff (in dev env and then again in production) because deploying changes by code is more effort then its worth.

Managing the codebase is straightforward -- that's what git's designed for. My question was more about the actual site contents, which will reside in the database. Can you use git for tracking changes to the contents?

Probably not. You're better off logging your MySQL queries and filtering out the UPDATE, INSERT, and DELETE queries for the tables you're interested in.

Re: Using git to manage a website

#17
I've been using Joe Maller's write-up[1] as a guide for a while.

I see this strategy removes the need for a second repo on the server. Other than removing a layer which would save space and lower the likelihood of errors in general are their significant pros/cons to either method.

[1] http://joemaller.com/990/a-web-focused-git-workflow/

Re: Using git to manage a website

#20

I use Fabric with mercurial to achieve a similar effect typing "fab prod deploy" - see Steve Losh's blog posts or bitbucket.org/kevinburke/goodmorningcmc

Yep, same here. I wonder why more people don't do it, my fabric scripts basically push to production and then fabric logs in and updates, restarts services, etc.
Post reply on HN