Skip to content

Commit

Permalink
use company repository account
Browse files Browse the repository at this point in the history
  • Loading branch information
isra67 committed Sep 28, 2017
1 parent 485f9b4 commit 75ef810
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 13 deletions.
21 changes: 15 additions & 6 deletions appdiff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,20 @@
# #################################################################################


## working repository
if [ -z "$1" ]; then
REPO="inoteska"
else
REPO="$1"
fi


## working dir
cd /root/app


VER_LOCAL=`git log -1 | grep commit | awk '{print $2}'`
VER_REMOTE=`git ls-remote https://github.com/isra67/indoorjs.git | grep HEAD | cut -f 1`
VER_REMOTE=`git ls-remote https://github.com/$REPO/indoorjs.git | grep HEAD | cut -f 1`

if [ "$VER_LOCAL" == "$VER_REMOTE" ]
then
Expand All @@ -23,11 +31,12 @@ then
else

## synchronize
if [ -z "$1" ]; then
./update.sh
else
./update.sh $1
fi
# if [ -z "$1" ]; then
# ./update.sh
# else
# ./update.sh $1
# fi
./update.sh $REPO

PID=`ps aux | grep -i '/node server' | grep -iv 'grep ' | sed 's/\s\+/ /g' | cut -d' ' -f 2`
kill $PID
Expand Down
24 changes: 17 additions & 7 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
#
# #################################################################################


## working repository
if [ -z "$1" ]; then
REPO="inoteska"
else
REPO="$1"
fi


## working dir
cd /root/app

Expand All @@ -26,13 +35,14 @@ git reset --hard
#fi
#git reset --hard ##gh/master

if [ -z "$1" ]; then
# git pull --rebase https://github.com/isra67/indoorjs.git master
git pull --rebase https://github.com/isra67/indoorjs.git
else
# git pull --rebase https://isra67:[email protected]/isra67/indoorjs.git master
git pull --rebase https://isra67:$1@github.com/isra67/indoorjs.git
fi
#if [ -z "$1" ]; then
## git pull --rebase https://github.com/isra67/indoorjs.git master
# git pull --rebase https://github.com/isra67/indoorjs.git
#else
## git pull --rebase https://isra67:[email protected]/isra67/indoorjs.git master
# git pull --rebase https://isra67:[email protected]/isra67/indoorjs.git
#fi
git pull --rebase https://$REPO@github.com/$REPO/indoorjs.git
git clean -dn

## restore app file from backup
Expand Down

0 comments on commit 75ef810

Please sign in to comment.