Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot capture the output from the plugin #115

Closed
marslo opened this issue Dec 19, 2024 · 2 comments · Fixed by #113
Closed

cannot capture the output from the plugin #115

marslo opened this issue Dec 19, 2024 · 2 comments · Fixed by #113
Labels
bug Something isn't working

Comments

@marslo
Copy link

marslo commented Dec 19, 2024

Describe the bug

I'd like to using jfrog plugin instead of jfrog cli installed in Jenkins agent in the pipeline.

However, I've noticed the jfrog plugin returns org.codehaus.groovy.runtime.NullObject class, details:

  • pipeline:
    withEnv([ "JFROG_BINARY_PATH=${tool 'jfrog-cli'}", "JFROG_CLI_LOG_LEVEL=DEBUG" ]) {
        println ".. start .. "
        def output = jf '-v'
        println ".. output.getClass(): ${output.getClass()} .."
        println ".. output: ${output} .."
    }
  • console output:
    jf version 2.72.2
    [Pipeline] echo
     .. output.getClass(): class org.codehaus.groovy.runtime.NullObject ..
    [Pipeline] echo
     .. output: null ..
    

system info:

  • script
    println( "Groovy: ${GroovySystem.version}" )
    println( "Jenkins: ${jenkins.model.Jenkins.instance.getVersion()}" )
    println( "OS: ${System.getProperty('os.name')} - ${System.getProperty('os.version')}" )
    println( "Java: ${System.getProperty('java.version')} - ${System.getProperty('java.vm.vendor')} (${System.getProperty('java.vm.name')})" )
    println "---"
    
    Jenkins.instance.pluginManager.plugins
        .collect()
        .findAll { it.getShortName().contains('jfrog') }
        .each {
            plugin -> println("${plugin.getShortName()}:${plugin.getVersion()}")
        }
    return
  • result
    Groovy: 2.4.21
    Jenkins: 2.479.2
    OS: Linux - 4.19.12-1.el7.elrepo.x86_64
    Java: 17.0.13 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
    ---
    jfrog:1.5.6
    

tools configuration in Jenkins:
Image

Current behavior

[Pipeline] echo
 .. start .. 
[Pipeline] jf
 Executing sh script inside container jnlp of pod jenkins-marslo-jfrog-plugin-12-cwhjp-h4nsj
 Executing command: "/home/devops/tools/io.jenkins.plugins.jfrog.JfrogInstallation/jfrog-cli/jf" "c" "add" "artifactoryha-dev" "--user=srv-ssd-fw-devops" ******** "--url=https://artifactory.sample.com" "--artifactory-url=https://artifactory.sample.com/artifactory" "--distribution-url=https://artifactory.sample.com/distribution" "--xray-url=https://artifactory.sample.com/xray" "--interactive=false" "--overwrite=true" 
 exit
 05:23:19 [Debug] JFrog CLI version: 2.72.2
 05:23:19 [Debug] OS/Arch: linux/amd64
 05:23:19 [Debug] Trace ID for JFrog Platform logs: ca52d39cf47ce320
 05:23:19 [Debug] JFrog CLI version: 2.72.2
 05:23:19 [Debug] OS/Arch: linux/amd64
 05:23:19 [Debug] Trace ID for JFrog Platform logs: ca52d39cf47ce320
 05:23:19 [Debug] Locking config file to run config AddOrEdit command.
 05:23:19 [Debug] Creating lock in: /home/devops/workspace/marslo/jfrog-plugin@tmp/jfrog/12/.jfrog/locks/config
 05:23:19 [Debug] Locking config file to run config AddOrEdit command.
 05:23:19 [Debug] Creating lock in: /home/devops/workspace/marslo/jfrog-plugin@tmp/jfrog/12/.jfrog/locks/config
 05:23:19 [Debug] config file is released.
 05:23:19 [Debug] config file is released.
 05:23:19 [Debug] Sending HTTP GET request to: https://artifactory.sample.com/artifactory/api/security/encryptedPassword
 05:23:19 [Debug] Sending HTTP GET request to: https://artifactory.sample.com/artifactory/api/security/encryptedPassword
 05:23:19 [Debug] Releasing lock: /home/devops/workspace/marslo/jfrog-plugin@tmp/jfrog/12/.jfrog/locks/config/jfrog-cli.conf.lck.59.1734585799264460889
 05:23:19 [Debug] Usage Report: Sending info...
 05:23:19 [Debug] Releasing lock: /home/devops/workspace/marslo/jfrog-plugin@tmp/jfrog/12/.jfrog/locks/config/jfrog-cli.conf.lck.59.1734585799264460889
 05:23:19 [Debug] Usage Report: Sending info...
 05:23:19 [Debug] Sending HTTP GET request to: https://artifactory.sample.com/artifactory/api/system/version
 05:23:19 [Debug] Sending HTTP GET request to: https://artifactory.sample.com/artifactory/api/system/version
 05:23:20 [Debug] Artifactory response: 200 OK
 05:23:20 [Debug] JFrog Artifactory version is: 7.90.8
 05:23:20 [Debug] Sending HTTP POST request to: https://artifactory.sample.com/artifactory/api/system/usage
 05:23:20 [Debug] Artifactory response: 200 OK
 05:23:20 [Debug] JFrog Artifactory version is: 7.90.8
 05:23:20 [Debug] Sending HTTP POST request to: https://artifactory.sample.com/artifactory/api/system/usage
 Executing sh script inside container jnlp of pod jenkins-marslo-jfrog-plugin-12-cwhjp-h4nsj
 Executing command: "/home/devops/tools/io.jenkins.plugins.jfrog.JfrogInstallation/jfrog-cli/jf" "-v" 
 exit
 jf version 2.72.2
 jf version 2.72.2
[Pipeline] echo
 .. output.getClass(): class org.codehaus.groovy.runtime.NullObject ..
[Pipeline] echo
 .. output: null ..

Reproduction steps

No response

Expected behavior

No response

JFrog plugin version

1.5.6

JFrog CLI version

2.72.2

Operating system type and version

Linux - 4.19.12-1.el7.elrepo.x86_64

JFrog Artifactory version

JFrog Platform Enterprise Plus 7.90.8 rev 79008900

JFrog Xray version

No response

@marslo marslo added the bug Something isn't working label Dec 19, 2024
@yahavi
Copy link
Member

yahavi commented Dec 19, 2024

@marslo
Thank you for using the Jenkins JFrog plugin!

The feature for capturing the JFrog CLI output has not been released yet.
We will notify you once it becomes available.

@yahavi
Copy link
Member

yahavi commented Dec 20, 2024

@marslo
The Jenkins JFrog plugin version 1.5.7 has been released, and it now supports capturing the output. Please upgrade and share your feedback with us!

@yahavi yahavi closed this as completed Dec 20, 2024
@yahavi yahavi linked a pull request Dec 20, 2024 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants