Skip to content

the option --fail-no-op doesn't work in jenkins scripted pipeline #57

@jinlxz

Description

@jinlxz

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

Image

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'
                    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions