add planRepositories config

This commit is contained in:
Francisco Schulz 2022-11-15 11:37:40 +01:00
parent b5deb7b292
commit 2fe4a75a57

View File

@ -2,6 +2,7 @@ package buildjob;
import com.atlassian.bamboo.specs.api.BambooSpec;
import com.atlassian.bamboo.specs.api.builders.BambooKey;
import com.atlassian.bamboo.specs.api.builders.applink.ApplicationLink;
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;
@ -13,6 +14,7 @@ import com.atlassian.bamboo.specs.api.builders.plan.Stage;
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.bitbucket.server.BitbucketServerRepository;
import com.atlassian.bamboo.specs.builders.task.CheckoutItem;
import com.atlassian.bamboo.specs.builders.task.InjectVariablesTask;
import com.atlassian.bamboo.specs.builders.task.ScriptTask;
@ -134,7 +136,7 @@ public class PlanSpec {
new Stage("License Stage")
.jobs(
new Job("License Job", new BambooKey("LICENSE"))
.enabled(false)
.enabled(true)
.tasks(
new VcsCheckoutTask()
.description("Checkout default repository.")
@ -151,7 +153,19 @@ public class PlanSpec {
"/usr/share/maven/ref/settings.xml")
.volume("/var/run/docker.sock",
"/var/run/docker.sock"))))
.linkedRepositories("RR / " + SERVICE_NAME)
// .linkedRepositories("RR / " + SERVICE_NAME)
.planRepositories(new BitbucketServerRepository()
.name("pyinfra")
.server(new ApplicationLink()
.name("bitbucket-server"))
.projectKey("RED")
.repositorySlug(SERVICE_NAME)
.branch("master")
.lfsEnabled(true)
.shallowClonesEnabled(true)
.fetchWholeRepository(false)
.remoteAgentCacheEnabled(false))
)
.triggers(new BitbucketServerTrigger())
.planBranchManagement(
new PlanBranchManagement()