Can I run a build chain using different brances?
Answered
Hi, I hope You can help me in my question.
I try to build pipeline like this:
develop (refs/heads/develop) \
> deploy
release (refs/heads/release) /
Build Dev must read develop branch, RC - release. It's important. Then, deploy collect artifacts from each builds and do some things.
There is any solving to realize my chain?
P.S. I can share my test DSL:
version = "2020.2"
project {
buildType(Composite)
buildType(Deploy)
buildType(Release)
buildType(Develop)
}
object Composite : BuildType({
name = "composite"
type = BuildTypeSettings.Type.DEPLOYMENT
vcs {
root(git) {
branchFilter = """
-:*
+:refs/heads/develop
+:refs/heads/release
""".trimIndent()
}
}
dependencies {
dependency(Develop) {
snapshot {
onDependencyFailure = FailureAction.CANCEL
onDependencyCancel = FailureAction.CANCEL
}
artifacts {
artifactRules = "develop-*=>app"
}
}
dependency(Release) {
snapshot {
onDependencyFailure = FailureAction.CANCEL
onDependencyCancel = FailureAction.CANCEL
}
artifacts {
artifactRules = "release-*=>app"
}
}
}
})
object Deploy : BuildType({
name = "deploy"
type = BuildTypeSettings.Type.DEPLOYMENT
steps {
script {
scriptContent = "ls"
}
}
dependencies {
dependency(Composite) {
snapshot {
onDependencyFailure = FailureAction.CANCEL
onDependencyCancel = FailureAction.CANCEL
}
artifacts {
artifactRules = "app=>/"
}
}
}
})
object Develop : BuildType({
name = "develop"
artifactRules = "develop-*"
vcs {
root(git)
branchFilter = """
-:*
+:refs/heads/develop
""".trimIndent()
}
steps {
script {
scriptContent = "touch develop-%build.number%"
}
}
})
object Release : BuildType({
name = "release"
artifactRules = "release-*"
vcs {
root(git)
branchFilter = """
-:*
+:refs/heads/release
""".trimIndent()
}
steps {
script {
scriptContent = "touch release-%build.number%"
}
}
})
Please sign in to leave a comment.
Hello Mikhail,
Just to clarify - per the build chain you have drawn at the top of the post, it appears as if both dev and RC builds are to be executed before you can proceed with the deploy. Do you aim to have a chain where you start Deployment build and it triggers both Develop and Release builds with their corresponding branches, or do you aim to have a chain where you start Deployment, and it triggers generic "Build" which can handle both develop and release branches?