Bitbucket Android管道在gradlew上总是失败



我正在尝试为我的Android项目使用Bitbucket Pipelines。

有我bitbucket-pipelines.yml

image: javiersantos/android-ci:latest
pipelines:
default:
- step:
script:
- export GRADLE_USER_HOME=`pwd`/.gradle
- chmod +x ./gradlew
- ./gradlew assembleDebug

当我运行管道时,我遇到此错误:

+ CHMOD +x ./gradlew

chmod:无法访问"./gradlew":没有这样的文件或目录

我在管道配置中错过了什么?

如果gradlew

文件不在Git 存储库的根文件夹中,则需要将其cd到包含该文件的文件夹中。您可以通过检查$BITBUCKET_CLONE_DIR环境变量或列出文件来检查 Docker 构建计算机中gradlew文件的位置:

pipelines:
default:
- step:
script:
- echo "The current folder is: $PWD"
- echo "The git repo root folder is: $BITBUCKET_CLONE_DIR"
- echo "The files in the git root directory are: $(ls -la)"
- echo "The folders in the git root directory are: $(echo */)"
- echo "The gradlew file is at location: $( find . -name "gradlew" -type f -print0 | xargs )"
- echo "Setting current working directory to subfolder"
- cd MyProject # This should contain your 'gradlew' file
- chmod +x ./gradlew
- ./gradlew assembleDebug

相关内容

最新更新