gpt4 book ai didi

android - 来自 Bitbucket 管道的权限被拒绝

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:33:47 25 4
gpt4 key购买 nike

我正在尝试使用 bitbucket 管道将我的构建 apk 上传到曲棍球应用程序,但是当我尝试运行我的脚本时,我得到了

bash: ./deploy-hockey-dev.sh: Permission denied

这是 deploy-hockey-dev.sh:

#!/bin/sh

# upload apk to hockey app
curl \
-F "status=2" \
-F "notify=0" \
-F "ipa=@app/build/outputs/apk/debug/app-debug.apk" \
-H "X-HockeyAppToken: myToken" \
https://rink.hockeyapp.net/api/2/apps/upload

有人知道这里的问题是什么吗?

最佳答案

问题是文件在 checkin BitBucket 之前没有被赋予正确的执行权限。

如果您在 unix 环境中进行本地开发,您通常会在脚本文件上设置执行权限(即 chmod 755),以便在提交之前可以在本地进行测试。使用这种方法,您在 checkin 管道构建时不会遇到权限被拒绝的错误。

但是,有时我们在没有 unix 模拟器的情况下在 Windows 上编写脚本,因此我们只能在管道环境中测试我们的脚本。尽管 Windows 不支持其文件系统中的执行权限,但我们仍然可以使用 git 来显示和设置这些执行权限。

cd <dir-with-shell-scripts>
git ls-files --stage # show file permissions (last 3 digits of first number)
git update-index --chmod=+x <files> # set execute permissions

按照您的正常流程提交更新的文件。

关于android - 来自 Bitbucket 管道的权限被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52973719/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com