Skip to content

Commit

Permalink
Added rollback code that adds to version f
Browse files Browse the repository at this point in the history
  • Loading branch information
liamr committed Mar 20, 2012
1 parent 3873249 commit 2628eaa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions application/controllers/deployment.php
Expand Up @@ -55,6 +55,16 @@ function post_receive(){
}

function rollback(){

log_message('debug', 'DEPLOYMENT: rollback to previous version - '. ENVIRONMENT);

//Write commit info to

$this->load->helper('file');

$data = 'SITE WAS ROLLED BACK TO PREVIOUS VERSION<br />';

write_file('./app_version', $data, 'a');

shell_exec('/usr/bin/git --git-dir="' . ENVIRONMENT_BASE . '.git" --work-tree="' . ENVIRONMENT_BASE . '" reset --hard HEAD~1');
//shell_exec('/usr/bin/git --git-dir="' . ENVIRONMENT_BASE . '.git" --work-tree="' . ENVIRONMENT_BASE . '" clean -f');
Expand Down

0 comments on commit 2628eaa

Please sign in to comment.