-
Notifications
You must be signed in to change notification settings - Fork 18
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
Commands getting executed twice #74
Comments
|
I have also noticed this issue when using the kubernetes plugin. Commands are not executed twice, but the logs are streamed twice. That PR changed the PrintWriter of the launcher on the created ProcStarter instance. However, the underlying launcher (in this case, the kubernetes specific launcher) still has a reference to the original logger. If the logger of the launcher != logger of the procstarter, the kubernetes plugins tees them both. That explains why the logs show up twice (see doLaunch code in https://github.com/jenkinsci/kubernetes-plugin/blob/master/src/main/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/ContainerExecDecorator.java for details.) I was able to get the jfrog plugin working correctly on kubernetes by removing the teeing from the jfrog plugin, since the kubernetes plugin already does the teeing. However, not sure if those code changes work for other agents.. |
Describe the bug
Currently, using Jfrog plugin in Jenkins along with Jfrog CLI is executing a single command twice whenever it is run inside a container.
When using Jenkins groovy commands inside a container, the command is executed twice; however, when the jf command is used inside a shell script, it is executed only once as expected.
Current behavior
Executing command: "jf" "mvn" "clean" "install" "-Dmaven.test.skip=true" "-f" "pom.xml
Ouput:
09:19:37 06:19:37 [Info] Running Mvn...
09:19:37 06:19:37 [Info] Running Mvn...
15:01:44 12:01:44 [Info] The build-info-extractor jar is not cached locally. Downloading it now...
15:01:44 You can set the repository from which this jar is downloaded.
15:01:44 Read more about it at https://jfrog.com/help/r/jfrog-cli/downloading-the-maven-and-gradle-extractor-jars
15:01:44 12:01:44 [Info] Downloading JFrog's Dependency from https://releases.jfrog.io/artifactory/oss-release-local/org/jfrog/buildinfo/build-info-extractor-maven3/2.40.0/build-info-extractor-maven3-2.40.0-uber.jar
15:01:44 12:01:44 [Info] The build-info-extractor jar is not cached locally. Downloading it now...
15:01:44 You can set the repository from which this jar is downloaded.
15:01:44 Read more about it at https://jfrog.com/help/r/jfrog-cli/downloading-the-maven-and-gradle-extractor-jars
15:01:44 12:01:44 [Info] Downloading JFrog's Dependency from https://releases.jfrog.io/artifactory/oss-release-local/org/jfrog/buildinfo/build-info-extractor-maven3/2.40.0/build-info-extractor-maven3-2.40.0-uber.jar
Reproduction steps
Installing Jfrog cli on Jenkins
Running test script:
pipeline {
agent any
tools {
jfrog 'jfrog-cli'
}
stages {
stage('Clone') {
steps {
git branch: 'master', url: "https://github.com/jfrog/project-examples.git"
}
}
}
Expected behavior
Command execution to be done only once.
JFrog plugin version
1.4.0
JFrog CLI version
2.43.1
Operating system type and version
Jenkins 2.401.2, Linux
JFrog Artifactory version
JFrog Cloud
JFrog Xray version
No response
The text was updated successfully, but these errors were encountered: