не работает shell script для git
#! /bin/sh
# Author: maxgu
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/usr/sbin:/usr/bin:/usr/lib
COMMAND=git
PROJECT_NAME="myproj"
PROJECT_DIR=/var/www/myhost.com
PROJECT_ENV="master"
# Exit if the git is not installed
[ -x "/usr/bin/$COMMAND" ] || exit 0
#
# start pulling
#
echo "start $PROJECT_NAME $PROJECT_ENV pulling"
cd $PROJECT_DIR
exec git --work-tree=$PROJECT_DIR pull origin $PROJECT_ENV
:
# Author: maxgu
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/usr/sbin:/usr/bin:/usr/lib
COMMAND=git
PROJECT_NAME="myproj"
PROJECT_DIR=/var/www/myhost.com
PROJECT_ENV="master"
# Exit if the git is not installed
[ -x "/usr/bin/$COMMAND" ] || exit 0
#
# start pulling
#
echo "start $PROJECT_NAME $PROJECT_ENV pulling"
cd $PROJECT_DIR
exec git --work-tree=$PROJECT_DIR pull origin $PROJECT_ENV
:
при запуске пишет:
start myproj master pulling
/usr/lib/git-core/git-sh-setup: 90: sed: not found
/usr/lib/git-core/git-sh-setup: 212: uname: not found
From mygithost-storage.com:myproj
* branch master -> FETCH_HEAD
/usr/lib/git-core/git-pull: 251: sed: not found
There are no candidates for merging among the refs that you just fetched.
Generally this means that you provided a wildcard refspec which had no
matches on the remote end
/usr/lib/git-core/git-sh-setup: 90: sed: not found
/usr/lib/git-core/git-sh-setup: 212: uname: not found
From mygithost-storage.com:myproj
* branch master -> FETCH_HEAD
/usr/lib/git-core/git-pull: 251: sed: not found
There are no candidates for merging among the refs that you just fetched.
Generally this means that you provided a wildcard refspec which had no
matches on the remote end
как правильно в bash скрипте выполнить git pull?
З.Ы. мне это нужно для того, что потом выполнять этот скрипт на post-update hook, т.е. как автоматически настроить автодеплой на сервер из git?
1 ответов
Такое чувство что у вас проблема с путями, то есть строку PATH я бы написал:
PATH=/bin:/usr/bin:/usr/lib:/usr/local/bin
Так как у вас не находятся стандартные утилиты sed и uname
Так как у вас не находятся стандартные утилиты sed и uname