@@ -97,6 +97,7 @@ protected String run() throws Exception {
97
97
EnvVars env = getContext ().get (EnvVars .class );
98
98
Run <?, ?> run = getContext ().get (Run .class );
99
99
100
+ workspace .mkdirs ();
100
101
boolean isWindows = !launcher .isUnix ();
101
102
String jfrogBinaryPath = getJFrogCLIPath (env , isWindows );
102
103
boolean passwordStdinSupported = isPasswordStdinSupported (workspace , env , launcher , jfrogBinaryPath );
@@ -144,6 +145,7 @@ protected String run() throws Exception {
144
145
public boolean isPasswordStdinSupported (FilePath workspace , EnvVars env , Launcher launcher , String jfrogBinaryPath ) throws IOException , InterruptedException {
145
146
TaskListener listener = getContext ().get (TaskListener .class );
146
147
JenkinsBuildInfoLog buildInfoLog = new JenkinsBuildInfoLog (listener );
148
+
147
149
boolean isPluginLauncher = launcher .getClass ().getName ().contains ("org.jenkinsci.plugins" );
148
150
if (isPluginLauncher ) {
149
151
buildInfoLog .info ("Launcher is a plugin launcher. Password stdin is not supported." );
@@ -160,7 +162,10 @@ public boolean isPasswordStdinSupported(FilePath workspace, EnvVars env, Launche
160
162
}
161
163
162
164
static String getJFrogCLIPath (EnvVars env , boolean isWindows ) {
165
+ // JFROG_BINARY_PATH is set according to the master OS. If not configured, the value of jfrogBinaryPath will
166
+ // eventually be 'jf' or 'jf.exe'. In that case, the JFrog CLI from the system path is used.
163
167
String jfrogBinaryPath = Paths .get (env .get (JFROG_BINARY_PATH , "" ), Utils .getJfrogCliBinaryName (isWindows )).toString ();
168
+ // Modify jfrogBinaryPath according to the agent's OS
164
169
return isWindows ?
165
170
FilenameUtils .separatorsToWindows (jfrogBinaryPath ) :
166
171
FilenameUtils .separatorsToUnix (jfrogBinaryPath );
0 commit comments