在jenkins中我有一个奇怪的问题,我不能在作业中复制文件,但是,在用户jenkins的命令行上,我可以做到这一点没有问题。jenkins没有权限复制文件 - 或者是否?
我在用户“詹金斯”下运行的debian上使用jenkins。
我将用户“詹金斯”添加到组“www-data”,以便我可以将文件复制到Apache的www文件夹。
目标文件夹的样子像这样的文件夹权限:
drwxrwxr-x 9 www-data www-data 4096 Jun 23 16:19 .
drwxrwxr-x 4 www-data www-data 4096 Jun 23 12:45 ..
-rw-rw-r-- 1 volker www-data 368 Jun 23 17:10 about.php
-rw-rw-r-- 1 volker www-data 366 Jun 23 17:10 bio.php
-rw-rw-r-- 1 volker www-data 370 Jun 23 17:10 contact.php
drwxrwxr-x 3 volker www-data 4096 Jun 23 16:19 content
drwxrwxr-x 3 volker www-data 4096 Jun 23 16:19 css
drwxrwxr-x 8 volker www-data 4096 Jun 23 16:19 default
drwxrwxr-x 3 volker www-data 4096 Jun 23 16:19 fonts
drwxrwxr-x 2 volker www-data 4096 Jun 23 13:40 image
drwxrwxr-x 3 volker www-data 4096 Jun 23 16:19 images
-rw-rw-r-- 1 volker www-data 372 Jun 23 17:10 impressum.php
-rw-rw-r-- 1 volker www-data 367 Jun 23 17:10 index.php
-rw-rw-r-- 1 volker www-data 296 Jun 23 13:52 kontakt.php
drwxrwxr-x 3 volker www-data 4096 Jun 23 16:19 layout
-rw-rw-r-- 1 volker www-data 367 Jun 23 17:10 news.php
-rw-rw-r-- 1 volker www-data 370 Jun 23 17:10 termine.php
-rw-rw-r-- 1 volker www-data 369 Jun 23 17:10 videos.php
所以一切都写为组www数据。
如果我使用詹金斯用户的文件在shell复制,我没有得到任何错误:
[email protected]:~/jobs/deploy_notundellende/workspace$ whoami
jenkins
[email protected]:~/jobs/deploy_notundellende/workspace$ cp -R * /var/www/nue
[email protected]:~/jobs/deploy_notundellende/workspace$
但是,如果我在詹金斯使用相同的命令本身,它失败,允许误差:
pwd
/var/lib/jenkins/jobs/deploy_notundellende/workspace
whoami
jenkins
cp -R about.php bio.php contact.php content css fonts images impressum.php index.php layout news.php termine.php videos.php /var/www/nue
cp: cannot create regular file `/var/www/nue/about.php': Permission denied
cp: cannot create regular file `/var/www/nue/bio.php': Permission denied
cp: cannot create regular file `/var/www/nue/contact.php': Permission denied
cp: cannot create regular file `/var/www/nue/content/videos.php': Permission denied
这怎么可能?有人有想法吗?
好吧,我得到它的工作,我重新启动了詹金斯服务器,它的工作。 我认为之前没有用,因为jenkins服务器在我更改权限时已经运行。 现在对我有意义,想想吧:) 无论如何,感谢任何人阅读和思考这个! – ferrari2k
规定,作为答案并接受。这就是stackoverflow将问题标记为已解决的问题。 – eis