【发布时间】:2020-07-22 23:15:42
【问题描述】:
我使用 Java 11 和 Gradle 6.2 创建了一个项目。我配置了 Bitbucket 管道并推送了更改,但 Bitbucket 找不到 Gradle 来运行它的命令。 我使用了这个管道配置 yml:
image: openjdk:11
pipelines:
default: #this runs for any unspecified branches
- step:
name: Install dependencies
caches:
- gradle
script:
- echo 'Put any bash command here'
- java -version
- step:
name: Run tests
script:
- bash ./gradlew test
- step:
name: Build artifacts
script:
- bash ./gradlew clean build
artifacts:
- build/**
pull-requests:
'**': #this runs as default for any branch not elsewhere defined
- step:
name: Install dependencies
caches:
- gradle
script:
- echo 'Put any bash command here'
- java -version
- step:
name: Run tests
script:
- bash ./gradlew test
- step:
name: Build artifacts
script:
- bash ./gradlew clean build
artifacts:
- build/**
branches:
master: #this runs only 'master' branch
- step:
name: Install dependencies
caches:
- gradle
script:
- echo 'Put any bash command here'
- java -version
- step:
name: Run tests
script:
- bash ./gradlew test
- step:
name: Build artifacts
script:
- bash ./gradlew clean build
artifacts:
- build/**
- step:
name: Deploy artifacts to the server
deployment: production
script:
- pipe: atlassian/scp-deploy:0.3.3
variables:
USER: $SERVER_USER
SERVER: $SERVER_IP
VERSION: $BUILD_VERSION
REMOTE_PATH: '/var/autotrack'
LOCAL_PATH: 'build/libs/autotrack-$VERSION.jar'
但我收到以下错误:
bash ./gradlew testbash: ./gradlew: No such file or directory
我该如何解决这个问题?
【问题讨论】:
标签: java gradle bitbucket gradlew bitbucket-pipelines