Skip to content

Commit

Permalink
Add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
EyalDelarea committed Jan 8, 2025
1 parent 64b23b3 commit 175ade4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/io/jenkins/plugins/jfrog/JfStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,18 @@ protected String run() throws Exception {
*/
public boolean isPasswordStdinSupported(FilePath workspace, EnvVars env, Launcher launcher, String jfrogBinaryPath) throws IOException, InterruptedException {
TaskListener listener = getContext().get(TaskListener.class);
JenkinsBuildInfoLog buildInfoLog = new JenkinsBuildInfoLog(listener);
boolean isPluginLauncher = launcher.getClass().getName().contains("org.jenkinsci.plugins");
if (isPluginLauncher) {
listener.getLogger().println("Launcher is a plugin launcher. Password stdin is not supported.");
buildInfoLog.info("Launcher is a plugin launcher. Password stdin is not supported.");
return false;
}
Launcher.ProcStarter procStarter = launcher.launch().envs(env).pwd(workspace);
Version currentCliVersion = getJfrogCliVersion(procStarter, jfrogBinaryPath);
boolean supported = currentCliVersion.isAtLeast(MIN_CLI_VERSION_PASSWORD_STDIN);

listener.getLogger().println("JFrog CLI version: " + currentCliVersion);
listener.getLogger().println("Password stdin supported: " + supported);
buildInfoLog.info("JFrog CLI version: " + currentCliVersion);
buildInfoLog.info("Password stdin supported: " + supported);

return supported;
}
Expand Down

0 comments on commit 175ade4

Please sign in to comment.