Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor build pipeline #1645

Merged
merged 31 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d071b37
Create composite build pipeline
Manangka Jul 22, 2024
14b71be
Add composite build to windows build
Manangka Jul 25, 2024
3e42bc0
Missed removing a project reference
Manangka Jul 25, 2024
b8641ae
Add missing imports
Manangka Jul 25, 2024
24c3d86
Create GitHub templates and apply them to the windows build to avoid …
Manangka Jul 25, 2024
5235945
Remove old GitHub integration template in favor of the new one
Manangka Jul 25, 2024
aa6adbf
Only build the master branch or branches with a pull request
Manangka Jul 25, 2024
2c281f4
Correct wrong default branch
Manangka Jul 25, 2024
3ddd291
Fix missing template error
Manangka Jul 25, 2024
91b9df4
Move github integration templates to the root project
Manangka Jul 25, 2024
0966902
Add missing vcs root
Manangka Jul 25, 2024
1f049e1
Move and rename the windows and linux templates
Manangka Jul 25, 2024
c43e68b
Refactor linux pipeline
Manangka Jul 25, 2024
74c2c6c
Try conditional buildscript in pipeline
Manangka Jul 25, 2024
565436b
More complicated script assembly
Manangka Jul 25, 2024
8139bb0
Add missing module import
Manangka Jul 25, 2024
321ae36
Refactor buildscript
Manangka Jul 25, 2024
b80e76b
Temporary disable commit status updates
Manangka Jul 25, 2024
f96851f
Add linux conditional header
Manangka Jul 25, 2024
970cf38
Add platform identifier
Manangka Jul 25, 2024
8ea7dcc
Create build template
Manangka Jul 25, 2024
30c6ede
Move duplicate build code to template
Manangka Jul 25, 2024
98f5833
Clean up. Move build steps to project file
Manangka Jul 25, 2024
65ffece
Move header generation logic to separate file. Split build step into…
Manangka Jul 26, 2024
e85d140
Refactor build binaries stage. Extract duplicate code to the template
Manangka Jul 26, 2024
c6b54ae
Fix incorrect artifact name in the build stage
Manangka Jul 26, 2024
717e041
Extract TestDelwaqCoupling logic to separate template
Manangka Jul 26, 2024
deeb247
Add line separator to generated script header
Manangka Jul 26, 2024
f6e54cb
Rename windows and linux projects. Renable Github commitstatus publisher
Manangka Jul 26, 2024
b680888
Merge branch 'main' into refactor_build_pipeline
Manangka Jul 26, 2024
2d7b81c
Merge branch 'main' into refactor_build_pipeline
Manangka Jul 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions .teamcity/Ribasim/Project.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
package Ribasim

import Ribasim.buildTypes.*
import Ribasim.vcsRoots.*
import Ribasim.buildTypes.GenerateTestmodels
import Ribasim.buildTypes.Ribasim_MakeGitHubRelease
import Ribasim.buildTypes.Ribasim_MakeQgisPlugin
import Ribasim.vcsRoots.Ribasim
import Ribasim_Linux.RibasimLinuxProject
import Ribasim_Windows.RibasimWindowsProject
import Templates.*
import jetbrains.buildServer.configs.kotlin.Project
import jetbrains.buildServer.configs.kotlin.projectFeatures.activeStorage
import jetbrains.buildServer.configs.kotlin.projectFeatures.awsConnection
Expand All @@ -16,9 +21,8 @@ object Project : Project({
buildType(Ribasim_MakeQgisPlugin)
buildType(Ribasim_MakeGitHubRelease)

template(GitHubIntegrationTemplate)
template(Linux_1)
template(Windows_1)
template(GithubCommitStatusIntegration)
template(GithubPullRequestsIntegration)

features {
awsConnection {
Expand Down Expand Up @@ -55,6 +59,6 @@ object Project : Project({
}
}

subProject(Ribasim_Linux.Project)
subProject(Ribasim_Windows.Project)
subProject(RibasimLinuxProject)
subProject(RibasimWindowsProject)
})
4 changes: 3 additions & 1 deletion .teamcity/Ribasim/buildTypes/GenerateTestmodels.kt
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
package Ribasim.buildTypes

import Templates.GithubCommitStatusIntegration
import jetbrains.buildServer.configs.kotlin.*
import jetbrains.buildServer.configs.kotlin.buildSteps.script
import jetbrains.buildServer.configs.kotlin.triggers.vcs

object GenerateTestmodels : BuildType({
templates(GitHubIntegrationTemplate)
templates(GithubCommitStatusIntegration)
name = "Generate Testmodels"

artifactRules = """ribasim\generated_testmodels => generated_testmodels.zip"""
publishArtifacts = PublishMode.SUCCESSFUL

vcs {
cleanCheckout = true
root(Ribasim.vcsRoots.Ribasim, ". => ribasim")
}

steps {
Expand Down
26 changes: 0 additions & 26 deletions .teamcity/Ribasim/buildTypes/GitHubIntegrationTemplate.kt

This file was deleted.

16 changes: 11 additions & 5 deletions .teamcity/Ribasim/buildTypes/Ribasim_MakeGitHubRelease.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
package Ribasim.buildTypes

import Ribasim_Linux.Linux_BuildRibasim
import Ribasim_Linux.Linux_TestRibasimBinaries
import Ribasim_Windows.Windows_BuildRibasim
import Ribasim_Windows.Windows_TestRibasimBinaries
import Templates.LinuxAgent
import jetbrains.buildServer.configs.kotlin.*
import jetbrains.buildServer.configs.kotlin.buildSteps.script
import jetbrains.buildServer.configs.kotlin.triggers.vcs

object Ribasim_MakeGitHubRelease : BuildType({
templates(Linux_1)
templates(LinuxAgent)
name = "Make GitHub Release"

params {
Expand All @@ -14,6 +19,7 @@ object Ribasim_MakeGitHubRelease : BuildType({

vcs {
root(Ribasim.vcsRoots.Ribasim)
cleanCheckout = true
}

steps {
Expand Down Expand Up @@ -52,7 +58,7 @@ object Ribasim_MakeGitHubRelease : BuildType({
artifactRules = "generated_testmodels.zip"
}
}
dependency(Ribasim_Linux.buildTypes.Linux_BuildRibasim) {
dependency(Linux_BuildRibasim) {
snapshot {
onDependencyFailure = FailureAction.FAIL_TO_START
}
Expand All @@ -62,7 +68,7 @@ object Ribasim_MakeGitHubRelease : BuildType({
artifactRules = "ribasim_linux.zip"
}
}
snapshot(Ribasim_Linux.buildTypes.Linux_TestRibasimBinaries) {
snapshot(Linux_TestRibasimBinaries) {
onDependencyFailure = FailureAction.FAIL_TO_START
}
dependency(Ribasim_MakeQgisPlugin) {
Expand All @@ -75,7 +81,7 @@ object Ribasim_MakeGitHubRelease : BuildType({
artifactRules = "ribasim_qgis.zip"
}
}
dependency(Ribasim_Windows.buildTypes.Windows_BuildRibasim) {
dependency(Windows_BuildRibasim) {
snapshot {
onDependencyFailure = FailureAction.FAIL_TO_START
}
Expand All @@ -85,7 +91,7 @@ object Ribasim_MakeGitHubRelease : BuildType({
artifactRules = "ribasim_windows.zip"
}
}
snapshot(Ribasim_Windows.buildTypes.Windows_TestRibasimBinaries) {
snapshot(Windows_TestRibasimBinaries) {
onDependencyFailure = FailureAction.FAIL_TO_START
}
}
Expand Down
4 changes: 3 additions & 1 deletion .teamcity/Ribasim/buildTypes/Ribasim_MakeQgisPlugin.kt
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package Ribasim.buildTypes

import Templates.LinuxAgent
import jetbrains.buildServer.configs.kotlin.*
import jetbrains.buildServer.configs.kotlin.buildSteps.script

object Ribasim_MakeQgisPlugin : BuildType({
templates(Linux_1)
templates(LinuxAgent)
name = "Make QGIS plugin"

artifactRules = "ribasim_qgis.zip"

vcs {
root(Ribasim.vcsRoots.Ribasim)
cleanCheckout = true
}

steps {
Expand Down
4 changes: 2 additions & 2 deletions .teamcity/Ribasim/vcsRoots/Ribasim.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ object Ribasim : GitVcsRoot({
url = "https://github.com/Deltares/Ribasim"
branch = "main"
branchSpec = """
+:refs/heads/*
+:refs/heads/main
+:refs/tags/*
-:refs/heads/gh-pages
+:refs/heads/gh-readonly-queue/*
""".trimIndent()
useTagsAsBranches = true
authMethod = password {
Expand Down
12 changes: 0 additions & 12 deletions .teamcity/Ribasim_Linux/Project.kt

This file was deleted.

78 changes: 78 additions & 0 deletions .teamcity/Ribasim_Linux/RibasimLinuxProject.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
package Ribasim_Linux

import Ribasim.vcsRoots.Ribasim
import Templates.*
import jetbrains.buildServer.configs.kotlin.BuildType
import jetbrains.buildServer.configs.kotlin.FailureAction
import jetbrains.buildServer.configs.kotlin.Project
import jetbrains.buildServer.configs.kotlin.triggers.vcs

object RibasimLinuxProject : Project({
id("Ribasim_Linux")
name = "Ribasim_Linux"

buildType(Linux_Main)
buildType(Linux_BuildRibasim)
buildType(Linux_TestRibasimBinaries)

template(LinuxAgent)
template(BuildLinux)
template(TestBinariesLinux)
})

object Linux_Main : BuildType({
name = "RibasimMain"

templates(GithubPullRequestsIntegration)

allowExternalStatus = true
type = Type.COMPOSITE

vcs {
root(Ribasim, ". => ribasim")
cleanCheckout = true
}

triggers {
vcs {
}
}

dependencies {
snapshot(Linux_TestRibasimBinaries) {
onDependencyFailure = FailureAction.FAIL_TO_START
}
}
})

object Linux_BuildRibasim : BuildType({
templates(
LinuxAgent,
GithubCommitStatusIntegration,
BuildLinux
)

name = "Build Ribasim"

artifactRules = """ribasim\build\ribasim => ribasim_linux.zip"""
})

object Linux_TestRibasimBinaries : BuildType({
templates(LinuxAgent, GithubCommitStatusIntegration, TestBinariesLinux)
name = "Test Ribasim Binaries"

dependencies {
dependency(Linux_BuildRibasim) {
snapshot {
}

artifacts {
id = "ARTIFACT_DEPENDENCY_570"
cleanDestination = true
artifactRules = """
ribasim_linux.zip!** => ribasim/build/ribasim
""".trimIndent()
}
}
}
})
64 changes: 0 additions & 64 deletions .teamcity/Ribasim_Linux/buildTypes/Linux_BuildRibasim.kt

This file was deleted.

Loading