Bachir Soussi Chiadmi 10 years ago
parent
commit
10de06dd70
1 changed files with 0 additions and 67 deletions
  1. 0 67
      test_remote_git_deployement.txt

+ 0 - 67
test_remote_git_deployement.txt

@@ -1,67 +0,0 @@
-#!/bin/bash
-#hook/pre-receive
-#CONFIG
-
-echo "- - - - PRE-RECEIVE - - - -"
-REPO="sites/all/modules/features" 
-echo $REPO
-
-#read oldrev newrev refname
-refname="refs/heads/sandbox"
-if [ $refname = "refs/heads/prod" ]; then
- BASE="public_html/base_d7"
-elif [ $refname = "refs/heads/sandbox" ]; then
- BASE="public_html/base_d7_sb"
-else
- BASE="none"
-fi
-
-echo $BASE
-
-if [ $BASE != "none" ]; then
- echo "===== UPDATE REPOSITORY | $refname  ====="
- unset GIT_DIR
- cd ~
- cd $BASE
- cd $REPO
- git add .
- git commit -m "Auto Commit"
- echo "====== OK ====="
-else
- echo "Warning Commit not deployed, please use sandbox or prod branch"
-fi
-
-
-#!/bin/bash
-#hook/post-receive
-#CONFIG
-echo "- - - - POST-RECEIVE - - - - "
-REPO="sites/all/modules/features"
-echo $REPO
-
-#read oldrev newrev refname
-refname="refs/heads/prod"
-if [ $refname = "refs/heads/prod" ]; then
- BASE="public_html/base_d7"
-elif [ $refname = "refs/heads/sandbox" ]; then
- BASE="public_html/base_d7_sb"
-else
- BASE="none"
-fi
-echo $BASE
-if [ $BASE != "none" ]; then
-  echo "===== DEPLOYING APP | $refname ====="
-  unset GIT_DIR
-  cd ~
-  cd $BASE
-  cd $REPO
-  if [ $refname = "refs/heads/prod" ]; then
-   git pull --ff-only origin prod
-  elif [ $refname = "refs/heads/sandbox" ]; then
-   git pull --ff-only origin sandbox
-  fi
-  echo $?
-  echo "====== OK ====="
-else
-  echo "Warning : Commit not deployed, please use prod branch"
-fi