build attempt fix
This commit is contained in:
parent
67fec70fbe
commit
02cc5b4cc4
@ -2,6 +2,8 @@ package buildjob;
|
|||||||
|
|
||||||
import com.atlassian.bamboo.specs.api.BambooSpec;
|
import com.atlassian.bamboo.specs.api.BambooSpec;
|
||||||
import com.atlassian.bamboo.specs.api.builders.BambooKey;
|
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.docker.DockerConfiguration;
|
||||||
import com.atlassian.bamboo.specs.api.builders.permission.PermissionType;
|
import com.atlassian.bamboo.specs.api.builders.permission.PermissionType;
|
||||||
import com.atlassian.bamboo.specs.api.builders.permission.Permissions;
|
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.BranchCleanup;
|
||||||
import com.atlassian.bamboo.specs.api.builders.plan.branches.PlanBranchManagement;
|
import com.atlassian.bamboo.specs.api.builders.plan.branches.PlanBranchManagement;
|
||||||
import com.atlassian.bamboo.specs.api.builders.project.Project;
|
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.task.*;
|
||||||
import com.atlassian.bamboo.specs.builders.trigger.BitbucketServerTrigger;
|
import com.atlassian.bamboo.specs.builders.trigger.BitbucketServerTrigger;
|
||||||
import com.atlassian.bamboo.specs.model.task.ScriptTaskProperties;
|
import com.atlassian.bamboo.specs.model.task.ScriptTaskProperties;
|
||||||
@ -59,21 +62,23 @@ public class PlanSpec {
|
|||||||
.stages(new Stage("Release")
|
.stages(new Stage("Release")
|
||||||
.manual(true)
|
.manual(true)
|
||||||
.jobs(createRelease()))
|
.jobs(createRelease()))
|
||||||
.linkedRepositories("RED / ui")
|
|
||||||
.linkedRepositories("Shared Libraries / common-ui")
|
|
||||||
.triggers(new BitbucketServerTrigger())
|
.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());
|
.planBranchManagement(new PlanBranchManagement().createForVcsBranch().delete(new BranchCleanup().whenInactiveInRepositoryAfterDays(30)).notificationForCommitters());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Job creatGinCloudPlatformImagesJob(String project) {
|
public Job creatGinCloudPlatformImagesJob(String project) {
|
||||||
return new Job("Build Job: " + project, new BambooKey(project.toUpperCase().replaceAll("-", "")))
|
return new Job("Build Job: " + project, new BambooKey(project.toUpperCase().replaceAll("-", "")))
|
||||||
.tasks(
|
.tasks(
|
||||||
new CleanWorkingDirectoryTask().description("My clean working directory task"),
|
new CleanWorkingDirectoryTask().description("My clean working directory task"),
|
||||||
// Checkout
|
// Checkout
|
||||||
new VcsCheckoutTask().description("Checkout Default Repository")
|
new VcsCheckoutTask().description("Checkout Default Repository")
|
||||||
.checkoutItems(new CheckoutItem().defaultRepository().path("redaction-ui")),
|
.checkoutItems(new CheckoutItem().repository("redaction-ui").path("redaction-ui")),
|
||||||
new VcsCheckoutTask().description("Checkout UI Shared Lib")
|
|
||||||
.checkoutItems(new CheckoutItem().repository("Shared Libraries / common-ui").path("common-ui")),
|
|
||||||
|
|
||||||
// Build
|
// Build
|
||||||
new ScriptTask().description("Build")
|
new ScriptTask().description("Build")
|
||||||
@ -87,9 +92,9 @@ public class PlanSpec {
|
|||||||
// read version from artifact
|
// read version from artifact
|
||||||
new InjectVariablesTask().path("redaction-ui/version.properties"),
|
new InjectVariablesTask().path("redaction-ui/version.properties"),
|
||||||
// commit release
|
// commit release
|
||||||
new VcsCommitTask().commitMessage("chore(release)").repository("RED / ui"),
|
new VcsCommitTask().commitMessage("chore(release)").repository("redaction-ui"),
|
||||||
// create tag with this version
|
// 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(
|
).dockerConfiguration(
|
||||||
new DockerConfiguration().image("nexus.iqser.com:5001/infra/release_build:2.9.1")
|
new DockerConfiguration().image("nexus.iqser.com:5001/infra/release_build:2.9.1")
|
||||||
.volume("/var/lib/docker", "/var/lib/docker")
|
.volume("/var/lib/docker", "/var/lib/docker")
|
||||||
@ -102,9 +107,9 @@ public class PlanSpec {
|
|||||||
public Job createRelease() {
|
public Job createRelease() {
|
||||||
return new Job("Create Release", new BambooKey("CRLS"))
|
return new Job("Create Release", new BambooKey("CRLS"))
|
||||||
.tasks(
|
.tasks(
|
||||||
new CleanWorkingDirectoryTask().description("My clean working directory task"),
|
new CleanWorkingDirectoryTask().description("My clean working directory task"),
|
||||||
new VcsCheckoutTask().description("Checkout Default Repository")
|
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")
|
new ArtifactDownloaderTask().description("Download version artifact")
|
||||||
.sourcePlan(new PlanIdentifier("RED", "UI"))
|
.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 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")
|
.dockerConfiguration(new DockerConfiguration().image("nexus.iqser.com:5001/infra/release_build:2.9.1")
|
||||||
.volume("/var/run/docker.sock", "/var/run/docker.sock"));
|
.volume("/var/run/docker.sock", "/var/run/docker.sock"));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user