Skip to content

Instantly share code, notes, and snippets.

@cmgmyr
Created August 19, 2013 18:02
Show Gist options
  • Save cmgmyr/6272152 to your computer and use it in GitHub Desktop.
Save cmgmyr/6272152 to your computer and use it in GitHub Desktop.

Revisions

  1. cmgmyr created this gist Aug 19, 2013.
    43 changes: 43 additions & 0 deletions post-update
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    #!/bin/sh
    #
    # hook file name: post-update

    echo
    echo "**** Pulling changes into server [Hub's post-update hook]"
    echo


    case " $1 " in
    *'refs/heads/develop'*)
    cd /var/www/vhosts/domain.com/dev/ || exit
    unset GIT_DIR
    git pull hub develop
    echo
    echo "Develop was pulled"
    echo

    php artisan migrate --env=staging
    ;;
    esac


    case " $1 " in
    *'refs/heads/master'*)
    cd /var/www/vhosts/domain.com/httpdocs/ || exit
    unset GIT_DIR
    git pull hub master
    echo
    echo "Master was pulled"
    echo

    php artisan migrate --env=production

    ;;
    esac

    rm -f app/storage/cache/*
    rm -f app/storage/views/*
    chmod -R 777 app/storage
    chmod -R 777 public/assets/uploads

    exec git-update-server-info