From 02cc5b4cc4a7206ab2bc41492dd21dbf077bebd2 Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Mon, 23 Aug 2021 13:58:49 +0300 Subject: [PATCH] build attempt fix --- .../src/main/java/buildjob/PlanSpec.java | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/bamboo-specs/src/main/java/buildjob/PlanSpec.java b/bamboo-specs/src/main/java/buildjob/PlanSpec.java index 516ca1f34..b825c5b0b 100644 --- a/bamboo-specs/src/main/java/buildjob/PlanSpec.java +++ b/bamboo-specs/src/main/java/buildjob/PlanSpec.java @@ -2,6 +2,8 @@ package buildjob; import com.atlassian.bamboo.specs.api.BambooSpec; import com.atlassian.bamboo.specs.api.builders.BambooKey; +import com.atlassian.bamboo.specs.api.builders.credentials.SharedCredentialsIdentifier; +import com.atlassian.bamboo.specs.api.builders.credentials.SharedCredentialsScope; import com.atlassian.bamboo.specs.api.builders.docker.DockerConfiguration; import com.atlassian.bamboo.specs.api.builders.permission.PermissionType; import com.atlassian.bamboo.specs.api.builders.permission.Permissions; @@ -14,6 +16,7 @@ import com.atlassian.bamboo.specs.api.builders.plan.artifact.Artifact; import com.atlassian.bamboo.specs.api.builders.plan.branches.BranchCleanup; import com.atlassian.bamboo.specs.api.builders.plan.branches.PlanBranchManagement; import com.atlassian.bamboo.specs.api.builders.project.Project; +import com.atlassian.bamboo.specs.builders.repository.git.GitRepository; import com.atlassian.bamboo.specs.builders.task.*; import com.atlassian.bamboo.specs.builders.trigger.BitbucketServerTrigger; import com.atlassian.bamboo.specs.model.task.ScriptTaskProperties; @@ -59,21 +62,23 @@ public class PlanSpec { .stages(new Stage("Release") .manual(true) .jobs(createRelease())) - .linkedRepositories("RED / ui") - .linkedRepositories("Shared Libraries / common-ui") .triggers(new BitbucketServerTrigger()) + .planRepositories(new GitRepository() + .name("redaction-ui") + .url("ssh://git@git.iqser.com:2222/red/ui.git") + .branch("master") + .authentication(new SharedCredentialsIdentifier("bamboo-agent") + .scope(SharedCredentialsScope.GLOBAL))) .planBranchManagement(new PlanBranchManagement().createForVcsBranch().delete(new BranchCleanup().whenInactiveInRepositoryAfterDays(30)).notificationForCommitters()); } public Job creatGinCloudPlatformImagesJob(String project) { return new Job("Build Job: " + project, new BambooKey(project.toUpperCase().replaceAll("-", ""))) .tasks( - new CleanWorkingDirectoryTask().description("My clean working directory task"), + new CleanWorkingDirectoryTask().description("My clean working directory task"), // Checkout new VcsCheckoutTask().description("Checkout Default Repository") - .checkoutItems(new CheckoutItem().defaultRepository().path("redaction-ui")), - new VcsCheckoutTask().description("Checkout UI Shared Lib") - .checkoutItems(new CheckoutItem().repository("Shared Libraries / common-ui").path("common-ui")), + .checkoutItems(new CheckoutItem().repository("redaction-ui").path("redaction-ui")), // Build new ScriptTask().description("Build") @@ -87,9 +92,9 @@ public class PlanSpec { // read version from artifact new InjectVariablesTask().path("redaction-ui/version.properties"), // commit release - new VcsCommitTask().commitMessage("chore(release)").repository("RED / ui"), + new VcsCommitTask().commitMessage("chore(release)").repository("redaction-ui"), // create tag with this version - new VcsTagTask().tagName("${bamboo.inject.APP_VERSION}").repository("RED / ui") + new VcsTagTask().tagName("${bamboo.inject.APP_VERSION}").repository("redaction-ui") ).dockerConfiguration( new DockerConfiguration().image("nexus.iqser.com:5001/infra/release_build:2.9.1") .volume("/var/lib/docker", "/var/lib/docker") @@ -102,9 +107,9 @@ public class PlanSpec { public Job createRelease() { return new Job("Create Release", new BambooKey("CRLS")) .tasks( - new CleanWorkingDirectoryTask().description("My clean working directory task"), + new CleanWorkingDirectoryTask().description("My clean working directory task"), new VcsCheckoutTask().description("Checkout Default Repository") - .checkoutItems(new CheckoutItem().defaultRepository()).cleanCheckout(true), + .checkoutItems(new CheckoutItem().repository("redaction-ui")).cleanCheckout(true), new ArtifactDownloaderTask().description("Download version artifact") .sourcePlan(new PlanIdentifier("RED", "UI")) @@ -115,7 +120,7 @@ public class PlanSpec { new ScriptTask().description("checkout tag").inlineBody("git checkout tags/${bamboo.inject.APP_VERSION}"), - new VcsBranchTask().branchName("release/${bamboo.inject.APP_VERSION}").repository("RED / ui")) + new VcsBranchTask().branchName("release/${bamboo.inject.APP_VERSION}").repository("redaction-ui")) .dockerConfiguration(new DockerConfiguration().image("nexus.iqser.com:5001/infra/release_build:2.9.1") .volume("/var/run/docker.sock", "/var/run/docker.sock")); }