Skip to content

Commit

Permalink
Move the get version to start
Browse files Browse the repository at this point in the history
  • Loading branch information
EyalDelarea committed Sep 12, 2024
1 parent 1e4ec20 commit 53e149a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/io/jenkins/plugins/jfrog/JfStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ public JfStep(Object args) {
@Override
public void perform(@NonNull Run<?, ?> run, @NonNull FilePath workspace, @NonNull EnvVars env, @NonNull Launcher launcher, @NonNull TaskListener listener) throws InterruptedException, IOException {
workspace.mkdirs();

this.isWindows = !launcher.isUnix();
this.jfrogBinaryPath = getJFrogCLIPath(env, isWindows);
this.currentCliVersion = getJfrogCliVersion(launcher.launch().envs(env).pwd(workspace));

// Build the 'jf' command
ArgumentListBuilder builder = new ArgumentListBuilder();
Expand Down Expand Up @@ -167,7 +169,6 @@ public Launcher.ProcStarter setupJFrogEnvironment(Run<?, ?> run, EnvVars env, La
FilePath jfrogHomeTempDir = Utils.createAndGetJfrogCliHomeTempDir(workspace, String.valueOf(run.getNumber()));
CliEnvConfigurator.configureCliEnv(env, jfrogHomeTempDir.getRemote(), jfrogCliConfigEncryption);
Launcher.ProcStarter jfLauncher = launcher.launch().envs(env).pwd(workspace).stdout(listener);
this.currentCliVersion = getJfrogCliVersion(launcher.launch().envs(env).pwd(workspace));
// Configure all servers, skip if all server ids have already been configured.
if (shouldConfig(jfrogHomeTempDir)) {
logIfNoToolProvided(env, listener);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public void testJFrogCliInstallationFromArtifactory(JenkinsRule jenkins) throws
// Download the latest CLI version.
// Using remote repository to 'releases.jfrog.io' in the client's Artifactory.
configureJfrogCliFromArtifactory(JFROG_CLI_TOOL_NAME_1, TEST_CONFIGURED_SERVER_ID, getRepoKey(TestRepository.CLI_REMOTE_REPO), true);
runPipeline(jenkins, "basic_version_command");
WorkflowRun job = runPipeline(jenkins, "basic_version_command");
assertTrue(job.getLog().contains("jf version "));
}

// Gets JfrogInstallation directory in Jenkins work root.
Expand Down

0 comments on commit 53e149a

Please sign in to comment.