public static GitBuildSource gitBuildSource(BuildConfig buildConfig) { GitBuildSource git = null; BuildConfigSpec spec = buildConfig.getSpec(); if (spec != null) { BuildSource source = spec.getSource(); if (source != null) { git = source.getGit(); } } return git; }
public BuildSourceBuilder( BuildSourceFluent<?> fluent , BuildSource instance ){ this.fluent = fluent; fluent.withContextDir(instance.getContextDir()); fluent.withGit(instance.getGit()); fluent.withSourceSecret(instance.getSourceSecret()); fluent.withType(instance.getType()); } public BuildSourceBuilder( BuildSource instance ){
public BuildSourceBuilder( BuildSourceFluent<?> fluent , BuildSource instance ){ this.fluent = fluent; fluent.withContextDir(instance.getContextDir()); fluent.withGit(instance.getGit()); fluent.withSourceSecret(instance.getSourceSecret()); fluent.withType(instance.getType()); } public BuildSourceBuilder( BuildSource instance ){
public BuildSourceBuilder( BuildSource instance ){ this.fluent = this; this.withContextDir(instance.getContextDir()); this.withGit(instance.getGit()); this.withSourceSecret(instance.getSourceSecret()); this.withType(instance.getType()); }
source.getGit() != null && source.getGit().getUri() != null) { if (jenkinsfilePath == null) { jenkinsfilePath = DEFAULT_JENKINS_FILEPATH; jenkinsfilePath = new File(source.getContextDir(), jenkinsfilePath).getPath(); GitBuildSource gitSource = source.getGit(); String branchRef = gitSource.getRef(); List<BranchSpec> branchSpecs = Collections.emptyList();
public BuildSourceBuilder( BuildSource instance ){ this.fluent = this; this.withContextDir(instance.getContextDir()); this.withGit(instance.getGit()); this.withSourceSecret(instance.getSourceSecret()); this.withType(instance.getType()); }
throw new NotFoundException("No BuildConfig source for " + remoteRepository); GitBuildSource gitSource = source.getGit(); if (gitSource == null) { throw new NotFoundException("No BuildConfig git source for " + remoteRepository);
public BuildCause(Build build) { if (build == null || build.getMetadata() == null) { return; } ObjectMeta meta = build.getMetadata(); uid = meta.getUid(); namespace = meta.getNamespace(); name = meta.getName(); if (build.getSpec() != null) { if (build.getSpec().getSource() != null && build.getSpec().getSource().getGit() != null) { GitBuildSource git = build.getSpec().getSource().getGit(); gitUri = git.getUri(); } if (build.getSpec().getRevision() != null && build.getSpec().getRevision().getGit() != null) { commit = build.getSpec().getRevision().getGit().getCommit(); } } }
public BuildSourceFluentImpl(BuildSource instance){ this.withBinary(instance.getBinary()); this.withContextDir(instance.getContextDir()); this.withDockerfile(instance.getDockerfile()); this.withGit(instance.getGit()); this.withImages(instance.getImages()); this.withSecrets(instance.getSecrets()); this.withSourceSecret(instance.getSourceSecret()); this.withType(instance.getType()); }
public BuildSourceBuilder(BuildSource instance,Boolean validationEnabled){ this.fluent = this; this.withBinary(instance.getBinary()); this.withContextDir(instance.getContextDir()); this.withDockerfile(instance.getDockerfile()); this.withGit(instance.getGit()); this.withImages(instance.getImages()); this.withSecrets(instance.getSecrets()); this.withSourceSecret(instance.getSourceSecret()); this.withType(instance.getType()); this.validationEnabled = validationEnabled; }
/** * Lazily creates the GitSource if need be then updates the git URL * @param buildConfig the BuildConfig to update * @param gitUrl the URL to the git repo * @param ref */ public static void updateGitSourceUrl(BuildConfig buildConfig, String gitUrl, String ref) { BuildConfigSpec spec = buildConfig.getSpec(); if (spec == null) { spec = new BuildConfigSpec(); buildConfig.setSpec(spec); } BuildSource source = spec.getSource(); if (source == null) { source = new BuildSource(); spec.setSource(source); } source.setType("Git"); GitBuildSource gitSource = source.getGit(); if (gitSource == null) { gitSource = new GitBuildSource(); source.setGit(gitSource); } gitSource.setUri(gitUrl); gitSource.setRef(ref); }
public BuildSourceBuilder(BuildSourceFluent<?> fluent,BuildSource instance,Boolean validationEnabled){ this.fluent = fluent; fluent.withBinary(instance.getBinary()); fluent.withContextDir(instance.getContextDir()); fluent.withDockerfile(instance.getDockerfile()); fluent.withGit(instance.getGit()); fluent.withImages(instance.getImages()); fluent.withSecrets(instance.getSecrets()); fluent.withSourceSecret(instance.getSourceSecret()); fluent.withType(instance.getType()); this.validationEnabled = validationEnabled; } public BuildSourceBuilder(BuildSource instance){