use of com.epam.pipeline.entity.git.GitCredentials in project cloud-pipeline by epam.
the class PipelineLauncher method launch.
public String launch(PipelineRun run, PipelineConfiguration configuration, List<String> endpoints, String nodeIdLabel, boolean useLaunch, String pipelineId, String clusterId) {
GitCredentials gitCredentials = configuration.getGitCredentials();
Map<SystemParams, String> systemParams = matchSystemParams(run, preferenceManager.getPreference(SystemPreferences.BASE_API_HOST), kubeNamespace, preferenceManager.getPreference(SystemPreferences.CLUSTER_ENABLE_AUTOSCALING), configuration, gitCredentials);
checkRunOnParentNode(run, nodeIdLabel, systemParams);
List<EnvVar> envVars = EnvVarsBuilder.buildEnvVars(run, configuration, systemParams, getExternalProperties(run.getInstance().getAwsRegionId()));
String pipelineCommand = commandBuilder.build(configuration, systemParams);
String gitCloneUrl = Optional.ofNullable(gitCredentials).map(GitCredentials::getUrl).orElse(run.getRepository());
String rootPodCommand = useLaunch ? String.format(LAUNCH_TEMPLATE, launchScriptUrl, launchScriptUrl, gitCloneUrl, run.getRevisionName(), pipelineCommand) : pipelineCommand;
LOGGER.debug("Start script command: {}", rootPodCommand);
executor.launchRootPod(rootPodCommand, run, envVars, endpoints, pipelineId, nodeIdLabel, configuration.getSecretName(), clusterId);
return pipelineCommand;
}
Aggregations