jenkinsci / jenkinsci/jfrog-plugin
the option --fail-no-op doesn't work in jenkins scripted pipeline
- Dominant language
- Java
- Stars
- 16
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
### How can we help?
I tried to upload some files to Artifactory, but it always fails when no matching files, can someone please help here?
```
withEnv(["JFROG_BINARY_PATH=${tool 'jfrog-cli'}"]) {
rc=jf 'rt upload video/* generic/jenkins/${JOB_NAME}/${BUILD_NUMBER}/ --build-name=${BUILD_NAME} --build-number=${BUILD_NUMBER} --fail-no-op=false'
rc=jf 'rt upload reports/**/* generic/jenkins/${JOB_NAME}/${BUILD_NUMBER}/ --build-name=${BUILD_NAME} --build-number=${BUILD_NUMBER} --fail-no-op=false'
rc=jf 'rt upload build/reports/**/* generic/jenkins/${JOB_NAME}/${BUILD_NUMBER}/ --archive --build-name=${BUILD_NAME} --build-number=${BUILD_NUMBER} --fail-no-op=false'
jf 'rt bce ${BUILD_NAME} ${BUILD_NUMBER}'
}
```
I tried the command with --fail-no-op=true and --fail-no-op=false in the pipeline, both of them didn't work
I know we can use something like below, but it's not straight-forward
```
files= findFiles(glob: 'reports/**/*')
if(files.length > 0){
rc=jf 'rt upload reports/**/* generic/jenkins/${JOB_NAME}/${BUILD_NUMBER}/ --build-name=${BUILD_NAME} --build-number=${BUILD_NUMBER} --fail-no-op=false'
}
```
Contributor guide
Research direction
Start with the scripted pipeline calls using withEnv and jf 'rt upload', reproducing the three upload patterns with --fail-no-op set to true and false. Compare the observed result with the documented no-matching-files behavior; done means the option works consistently in the Jenkins pipeline or the limitation is clearly identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- ci-cd, devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100