Skip to content

Commit

Permalink
Test speculative plan in ssh (#1121)
Browse files Browse the repository at this point in the history
  • Loading branch information
alfespa17 authored Jul 24, 2024
1 parent 7283742 commit 5d8cf82
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ WorkspaceData getWorkspace(String organizationName, String workspaceName, Map<St
attributes.put("execution-mode", workspace.get().getExecutionMode());
attributes.put("global-remote-state", true);

if (workspace.get().getFolder() != null && workspace.get().getVcs() != null && !workspace.get().getFolder().equals("/")){
if (workspace.get().getFolder() != null && (workspace.get().getVcs() != null || workspace.get().getSsh() != null) && !workspace.get().getFolder().equals("/")){
attributes.put("working-directory", workspace.get().getFolder());
}

Expand Down Expand Up @@ -767,11 +767,12 @@ RunsData createRun(RunsData runsData) throws SchedulerException, ParseException
job.setVia("CLI");
job.setTemplateReference(template.getId().toString());
// if the vcs connection is not null, we need to override the value inside the job
if(workspace.getVcs() != null){
if(workspace.getVcs() != null || workspace.getSsh() != null){
log.warn("Workspace is using VCS connection, overriding vcs source and branch to run job using a remote plan");
job.setOverrideBranch("remote-content");
job.setOverrideSource(sourceTarGz);
}

job = jobRepository.save(job);
log.info("Job Created");
scheduleJobService.createJobContext(job);
Expand Down

0 comments on commit 5d8cf82

Please sign in to comment.