Search in sources :

Example 6 with GitCredentials

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;
}
Also used : GitCredentials(com.epam.pipeline.entity.git.GitCredentials) EnvVar(io.fabric8.kubernetes.api.model.EnvVar)

Aggregations

GitCredentials (com.epam.pipeline.entity.git.GitCredentials)6 DtsSubmission (com.epam.pipeline.entity.dts.DtsSubmission)1 GitRepositoryUrl (com.epam.pipeline.entity.git.GitRepositoryUrl)1 GitlabUser (com.epam.pipeline.entity.git.GitlabUser)1 Pipeline (com.epam.pipeline.entity.pipeline.Pipeline)1 PipelineRun (com.epam.pipeline.entity.pipeline.PipelineRun)1 DtsRequestException (com.epam.pipeline.exception.DtsRequestException)1 SystemParams (com.epam.pipeline.manager.execution.SystemParams)1 EnvVar (io.fabric8.kubernetes.api.model.EnvVar)1 File (java.io.File)1 Test (org.junit.Test)1