0832ca59 by Jeff Balicki

deploy

1 parent 933476eb
1 <?php 1 <?php
2 2
3 // Set Variables
4 $LOCAL_ROOT = "/var/www/html/";
5 $LOCAL_REPO_NAME = "banners-with-skip";
6 $LOCAL_REPO = "{$LOCAL_ROOT}/{$LOCAL_REPO_NAME}";
7 $REMOTE_REPO = "git@git.gotenzing.com:jeffmbalicki/banners-with-skip.git";
8 $BRANCH = "deploy";
9 3
10 4 shell_exec("sudo git pull");
11
12 if( file_exists($LOCAL_REPO) ) {
13
14 // If there is already a repo, just run a git pull to grab the latest changes
15 shell_exec("cd {$LOCAL_REPO} && sudo git pull");
16 echo 'done'; 5 echo 'done';
17 die("done " . mktime()); 6 die("done " . mktime());
18 } else {
19
20 // If the repo does not exist, then clone it into the parent directory
21 shell_exec("cd {$LOCAL_ROOT} && sudo git clone {$REMOTE_REPO}");
22 7
23 die("done " . mktime());
24 }
25 8
26 9
27 ?> 10 ?>
......