Travis.yml ./gradlew:权限被拒绝 [英] Travis.yml ./gradlew : Permission denied
问题描述
使用 Travis CI 调用现有的Android项目
$ ./gradlew build connectedCheck
我收到此错误:
/home/travis/build.sh:line 45:./gradlew:Permission denied
命令./gradlew build connectedCheck失败,并在126秒内退出。
/ strong>到您的unix gradlew
脚本。
strong>
git update-index --chmod = + x gradlew
pre>
一点描述来了解问题。
首先,您可以使用以下方式检查您的权限:git ls-tree HEAD
会看到:
100644 blob xxxxxxxxxxx gradlew
正如你可以看到的文件有644权限。
通过将gradlew文件上的可执行标志更改为755,修复此问题:
git update-index --chmod = + x gradlew
只要提交并推送更改:
git commit -mtravis权限访问
$ b b [master e80ab1b] gradlew对travis的权限访问
1个文件已更改,0个插入(+),0个删除( - )
模式更改100644 = 100755 gradlew
最后一次检查是否运行git ls-tree查看更改:
git ls-tree HEAD
您可以看到:
100755 blob xxxxxxxxxxxxx gradlew
另一种解决此问题的方法是使用:
before_install:
- chmod + x gradlew
b $ b这种解决方案不会改变你的git仓库的权限,只是改变执行的权限运行时。
Using Travis CI for an existing Android project calling
$ ./gradlew build connectedCheck
I get this error:
/home/travis/build.sh: line 45: ./gradlew: Permission denied The command "./gradlew build connectedCheck" failed and exited with 126 during .
解决方案It depends by the exec-permission to your unix
gradlew
script.It can be fixed using the command:
git update-index --chmod=+x gradlew
A little desciption to understand the problem.
First of all you can check your permissions using:git ls-tree HEAD
You will see:
100644 blob xxxxxxxxxxx gradlew
As you can see the file has 644 permission.
Fix it by setting the executable flag on your gradlew file changing it to 755:
git update-index --chmod=+x gradlew
Just commit and push the changes:
git commit -m "permission access for travis" [master e80ab1b] gradlew permission access for travis 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 gradlew
A last check running git ls-tree again to see the change:
git ls-tree HEAD
You can see:
100755 blob xxxxxxxxxxxxx gradlew
Another way to solve this issue is to use:
before_install: - chmod +x gradlew
This kind of solution doesn't change the permission in your git repo, but just changes the permission runtime in the execution.
这篇关于Travis.yml ./gradlew:权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!