Skip to content

Instantly share code, notes, and snippets.

@ibourgeois
Last active December 16, 2015 22:57

Revisions

  1. Derek Bourgeois revised this gist Dec 16, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion deploy.php
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@

    if ( $_SERVER[ 'HTTP_X_GITHUB_EVENT' ] == 'push' || $_POST[ 'payload' ] )
    {
    shell_exec( 'cd ' . $repo . ' && git reset --hard HEAD && git pull' );
    shell_exec( 'cd ' . $path . ' && git reset --hard HEAD && git pull' );
    $status = 'Successful';
    }
    ?>
  2. Derek Bourgeois revised this gist Dec 16, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion deploy.php
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,8 @@
    $path = '/var/www/repo';
    $status = 'Not Successful';

    if ($_SERVER['HTTP_X_GITHUB_EVENT'] == 'push') {
    if ( $_SERVER[ 'HTTP_X_GITHUB_EVENT' ] == 'push' || $_POST[ 'payload' ] )
    {
    shell_exec( 'cd ' . $repo . ' && git reset --hard HEAD && git pull' );
    $status = 'Successful';
    }
  3. Derek Bourgeois revised this gist Dec 16, 2015. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions deploy.php
    Original file line number Diff line number Diff line change
    @@ -6,8 +6,6 @@
    shell_exec( 'cd ' . $repo . ' && git reset --hard HEAD && git pull' );
    $status = 'Successful';
    }

    return $status;
    ?>

    <!DOCTYPE html>
  4. Derek Bourgeois revised this gist Dec 16, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion deploy.php
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,9 @@
    <?php
    $path = '/var/www/repo';
    $status = 'Not Successful';

    if ($_SERVER['HTTP_X_GITHUB_EVENT'] == 'push') {
    shell_exec( 'cd /var/www/repo && git reset --hard HEAD && git pull' );
    shell_exec( 'cd ' . $repo . ' && git reset --hard HEAD && git pull' );
    $status = 'Successful';
    }

  5. Derek Bourgeois created this gist Dec 16, 2015.
    24 changes: 24 additions & 0 deletions deploy.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    <?php
    $status = 'Not Successful';

    if ($_SERVER['HTTP_X_GITHUB_EVENT'] == 'push') {
    shell_exec( 'cd /var/www/repo && git reset --hard HEAD && git pull' );
    $status = 'Successful';
    }

    return $status;
    ?>

    <!DOCTYPE html>
    <html>
    <head>
    <title>Deploy Status: <?php echo $status; ?></title>
    </head>
    <body>
    <br />
    <br />
    <center>
    <h1>Deploy Status: <?php echo $status; ?></h1>
    </center>
    </body>
    </html>