Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Issue #795 Add pipeline which periodically updates the projects dependencies to the latest version #804

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

Merged
merged 2 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
78 changes: 77 additions & 1 deletion .teamcity/settings.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import jetbrains.buildServer.configs.kotlin.buildSteps.script
import jetbrains.buildServer.configs.kotlin.projectFeatures.ProjectReportTab
import jetbrains.buildServer.configs.kotlin.projectFeatures.projectReportTab
import jetbrains.buildServer.configs.kotlin.triggers.finishBuildTrigger
import jetbrains.buildServer.configs.kotlin.triggers.schedule
import jetbrains.buildServer.configs.kotlin.triggers.vcs

/*
Expand Down Expand Up @@ -66,6 +67,7 @@ project {
}

subProject(Nightly)
subProject(Pixi)
}

object GitHubIntegrationTemplate : Template({
Expand Down Expand Up @@ -422,4 +424,78 @@ object NightlyTests : BuildType({
}
}
}
})
})

object Pixi : Project({
name = "Pixi"

buildType(UpdateDependencies)
})

object UpdateDependencies : BuildType({
name = "Update Dependencies"

params {
param("GT_USER", "deltares-service-account")
password("env.GH_TOKEN", "credentialsJSON:ced4991a-a11d-463b-b79a-a657eea89523")
}

vcs {
root(AbsoluteId("iMOD6_IMODPython_ImodPython"), "+:. => imod-python")

cleanCheckout = true
}

steps {
powerShell {
name = "Update dependencies"
id = "Update_dependencies"
workingDir = "imod-python"
scriptMode = script {
content = """
${'$'}env:Path = '%system.teamcity.build.checkoutDir%\gh\bin;' + ${'$'}env:Path

echo "Create update branch"

git remote set-url origin https://%GT_USER%:%env.GH_TOKEN%@github.com/Deltares/imod-python.git
git checkout -b pixi_update_%build.counter%

echo "Update dependencies"
del pixi.lock
pixi install

echo "Add any changes"
git add pixi.lock

if (git status -suno)
{
git commit -m "Update pixi.lock"
git push -u origin pixi_update_%build.counter%
pixi run gh pr create --title "[TEAMCITY] Update project dependencies" --body "Teamcity automatically updated the dependencies defined the pixi.toml file. Please verify that all tests succeed before merging" --reviewer JoerivanEngelen,luitjansl
echo "Changes pushed and PR created"
}
else
{
echo "No changes found"
}
""".trimIndent()
}
noProfile = false
}
}

triggers {
schedule {
schedulingPolicy = weekly {
hour = 15
}
branchFilter = "+:<default>"
triggerBuild = always()
withPendingChangesOnly = false
}
}

failureConditions {
errorMessage = true
}
})
98 changes: 86 additions & 12 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ dask = "<2024.1.0" # Newer version incompatible with rasterio
fastcore = "*"
flopy = "*"
geopandas = "*"
gh = "*"
graphviz = "*"
hypothesis = "*"
jinja2 = "*"
Expand Down