从Jenkins将远程存储库拉到ubuntu目录时出错

时间:2018-09-19 09:32:09

标签: jenkins github ubuntu-16.04

这是我在Jenkins上的配置脚本

#!/bin/bash

echo ""
echo "Switching to project docroot."
cd /var/www/html/testdrupal.localhost/public_html
echo ""
echo "Pulling down the latest code."
git pull origin master
echo ""
echo "Clearing drush caches."
drush cache-clear drush
echo ""
echo "Running database updates."
drush updb -y
echo ""
echo "Importing configuration."
drush config-import -y
echo ""
echo "Clearing caches."
drush cr
echo ""
echo "Deployment complete."

但是,由于此错误,任务执行失败:

Pulling down the latest code.
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我的git存储库如下:https://github.com/myId/drupaltest

此外,这是docroot内部.git文件夹的内容:

drwxrwxrwx  7 root    root    4096 Sep 19 11:12 .
drwxr-xr-x  4 root    root    4096 Sep 19 10:45 ..
drwxrwxrwx  2 root    root    4096 Sep 19 10:44 branches
-rwxrwxrwx  1 root    root      92 Sep 19 10:44 config
-rwxrwxrwx  1 root    root      73 Sep 19 10:44 description
-rwxrwxrwx  1 jenkins jenkins   81 Sep 19 11:11 FETCH_HEAD
-rwxrwxrwx  1 root    root      23 Sep 19 10:44 HEAD
drwxrwxrwx  2 root    root    4096 Sep 19 10:44 hooks
drwxrwxrwx  2 root    root    4096 Sep 19 10:44 info
drwxrwxrwx 11 root    root    4096 Sep 19 11:11 objects
drwxrwxrwx  4 root    root    4096 Sep 19 10:44 refs

编辑

我已经更新了docroot:

cd /var/www/html/testdrupal.localhost/public_html/drupaltest

现在错误已更改:

error: can not open .git / FETCH_HEAD: Permission denied

只需为.git文件夹设置正确的权限?

0 个答案:

没有答案