Git for Websites / post-receive / Separation of Test and Production Sites -


I am using guit for the management of source code and deployment of my website, and currently testing and live sites The same is going on at the box. Basically after this resource, I came up with the following post received hook script which distinguishes between pushing on my live site and pushing my test to the site:

  while the Reef Reef Up: "#EEEEEE $ ref - will print something like the example at the top of the file's result =" echo $ ref gawk -f '' {print $ 3} '`if [$ result! =" "]; Then" Branch found: "Reef / Head / Master Result results in $ $ result - git --work-tree = c: / temp / BLAH f E-mail address "update master" echo;; refs / head / testbranch;); git --work-tree = c: / temp / BLAH2 checkout- f testbroken "update testbrunch" echo ;; *) echo "No result results $ Not known for ";; ASACE has completed" post-recovery updates ", however,  

However, I suspect that it is actually safe :) I do not mean any git expert Am, but I'm guessing that Git may probably be the current check-out branch chief Keeps track, and this approach probably has the ability to confuse it by the end.

Then there are some questions:

  1. Is it safe?

  2. What should be a better view of my base repository test site repository (with related working directory), and then in that repository a new live site is converted into a repository, Is there a working directory related to live site base? This will allow me to move production to a different server and maintain the deployment chain.

  3. Am I missing something? Is there a different, clean way to differentiate between testing and production deployment while using guit for the management of websites?

As an extra note in the light of V's answer, is there any good way to do this, in the way the file system will handle deletion without colliding with the system?

Thank you, -walt

PS - I came across several repo scripts until I hear better) as follows:

  Sitename = `basename` \ pwd \" when read refresh, #echo "Reef is updated:" #EEEEE $ ref - will print something like the example of the file result on example = `echo $ ref | Gawk -F '' '{Print $ 3}' `If [$ Result! = ""]; Then "get the branch:" the result is the result of the result in $ refs / head / master) git checkout -q -f master if [$? -E 0 0]; Then "Test site fix checks out" Echo resounds "checkout test site failed!" Fi ;; Refs / heads / live-site) git push -q ../Live/$sitename Live-site: master if [$? -E 0 0]; Then buzz "live site updates properly" and then "fail to push updates on live site";; *) Echo "No Results Known for Results" ;; ASACE completed "Post-Acquisition updates" echo  

and then reps in ../Live/$sitename ("Join" repo with work trees added after these inset ) Basic after received:

  git checkout -f if [$? -E 0 0]; Then "live site" bassname \ 'pwd \' was echoed out "successfully checked" echo and then "failed to checkout live site" fi  

Is there a related working directory for live site base? Yes, it will be allowed to move on a different server and maintain necessary deployment.

Yes, this is definitely a very rare opportunity that you want your test site to be your production site It is hosted next to the site. In almost every regard it is dangerous and informal, not to talk about database corruption, webserver lockpops etc.

I usually have a VM setup works very well and I can travel with me on my laptop.

Using git to deploy on your website is a great idea, so much to do There are people (like Rob Connery) if you have a live and testing site, then you should have different branches in your repository, set up the remote-tracking branches on the compatible server repository. As much as your workflow gets to work in your test branch, press it to merge to test, test, survive and live.

Honestly, it does not make it very difficult for myself.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -