Home
DevCentral
Search
Configure Global Search
Log In
Transactions
P9
Change Details
Change Details
Old
New
Diff
#!/bin/sh #Config GIT=/usr/local/bin/git WWW=/var/wwwroot/nasqueron.org/tools REPO=/home/dereckson/dev/nasqueron/tools/repo REPOUSER=dereckson WWWUSER=nasqueron.org WWWGROUP=web DEFAULTBRANCH=master cd $REPO #Checks we're in the correct branch echo Checking branch... branch_name="$(git symbolic-ref HEAD 2>/dev/null)" || branch_name="(unnamed branch)" # detached HEAD branch_name=${branch_name##refs/heads/} if [ "$branch_name" != "$DEFAULTBRANCH" ]; then if [ "$1" != "-f" ] && [ "$1" != "--force" ]; then echo "!!! You're on the branch $branch_name." echo "!!! Deployment should occur from branch $DEFAULTBRANCH." echo "!!! To force the deployment, use -f or --force option." exit fi fi #Okay, let's go if [ "$branch_name" = "$DEFAULTBRANCH" ]; then echo Pushing changes to BitBucket private repository... su $REPOUSER -c "$GIT push bitbucket $DEFAULTBRANCH" echo Pushing changes to GitHub public repository... su $REPOUSER -c "$GIT push github $DEFAULTBRANCH" echo Pushing changes to production... cd $WWW branch_name="$(git symbolic-ref HEAD 2>/dev/null)" || branch_name="(unnamed branch)" # detached HEAD branch_name=${branch_name##refs/heads/} chown -R $REPOUSER $REPO/.git if [ "$branch_name" = "$DEFAULTBRANCH" ]; then su $WWWUSER -c "$GIT pull $REPO" su $WWWUSER -c make clean all exit fi echo "!!! You're on the branch $branch_name on the wwwroot." echo "!!! Deployment should occur to branch $DEFAULTBRANCH." echo "!!! To force the deployment, use the following instructions:" echo " cd $WWW" echo " su $WWWUSER -c \"$GIT pull $REPO\"" fi
#!/bin/sh #Config GIT=/usr/local/bin/git WWW=/var/wwwroot/nasqueron.org/tools REPO=/home/dereckson/dev/nasqueron/tools/repo REPOUSER=dereckson WWWUSER=nasqueron.org WWWGROUP=web DEFAULTBRANCH=master cd $REPO #Checks we're in the correct branch echo Checking branch... branch_name="$(git symbolic-ref HEAD 2>/dev/null)" || branch_name="(unnamed branch)" # detached HEAD branch_name=${branch_name##refs/heads/} if [ "$branch_name" != "$DEFAULTBRANCH" ]; then if [ "$1" != "-f" ] && [ "$1" != "--force" ]; then echo "!!! You're on the branch $branch_name." echo "!!! Deployment should occur from branch $DEFAULTBRANCH." echo "!!! To force the deployment, use -f or --force option." exit fi fi #Okay, let's go if [ "$branch_name" = "$DEFAULTBRANCH" ]; then echo Pushing changes to BitBucket private repository... su $REPOUSER -c "$GIT push bitbucket $DEFAULTBRANCH" echo Pushing changes to GitHub public repository... su $REPOUSER -c "$GIT push github $DEFAULTBRANCH" echo Pushing changes to production... cd $WWW branch_name="$(git symbolic-ref HEAD 2>/dev/null)" || branch_name="(unnamed branch)" # detached HEAD branch_name=${branch_name##refs/heads/} chown -R $REPOUSER $REPO/.git if [ "$branch_name" = "$DEFAULTBRANCH" ]; then su $WWWUSER -c "$GIT pull $REPO" su $WWWUSER -c make clean all exit fi echo "!!! You're on the branch $branch_name on the wwwroot." echo "!!! Deployment should occur to branch $DEFAULTBRANCH." echo "!!! To force the deployment, use the following instructions:" echo " cd $WWW" echo " su $WWWUSER -c \"$GIT pull $REPO\"" fi
Continue