104 lines
2.7 KiB
Kotlin
104 lines
2.7 KiB
Kotlin
import jetbrains.buildServer.configs.kotlin.*
|
|
import jetbrains.buildServer.configs.kotlin.buildSteps.script
|
|
import jetbrains.buildServer.configs.kotlin.triggers.vcs
|
|
import jetbrains.buildServer.configs.kotlin.vcs.GitVcsRoot
|
|
|
|
/*
|
|
* ClearGrow Probe - TeamCity Build Configuration
|
|
* Zephyr RTOS project build verification
|
|
*/
|
|
|
|
version = "2024.12"
|
|
|
|
project {
|
|
description = "ClearGrow Probe - Zephyr Firmware"
|
|
|
|
vcsRoot(ProbeVcs)
|
|
buildType(Build)
|
|
}
|
|
|
|
object ProbeVcs : GitVcsRoot({
|
|
name = "ClearGrow Probe"
|
|
url = "https://git.cleargrow.io/Brent/probe.git"
|
|
branch = "refs/heads/main"
|
|
branchSpec = """
|
|
+:refs/heads/*
|
|
+:refs/pull/*/head
|
|
""".trimIndent()
|
|
authMethod = password {
|
|
userName = "%gitea.username%"
|
|
password = "%gitea.token%"
|
|
}
|
|
})
|
|
|
|
object Build : BuildType({
|
|
name = "Build"
|
|
description = "Zephyr RTOS build verification"
|
|
|
|
vcs {
|
|
root(ProbeVcs)
|
|
cleanCheckout = true
|
|
}
|
|
|
|
steps {
|
|
script {
|
|
name = "Build with Zephyr"
|
|
scriptContent = """
|
|
#!/bin/bash
|
|
set -e
|
|
|
|
echo "=== ClearGrow Probe Build ==="
|
|
echo "Commit: %build.vcs.number%"
|
|
echo "Branch: %teamcity.build.branch%"
|
|
echo ""
|
|
|
|
# Run build inside Docker container
|
|
docker run --rm \
|
|
-v "${'$'}(pwd):/project" \
|
|
-w /project \
|
|
ghcr.io/zephyrproject-rtos/ci:v0.26.13 \
|
|
bash -c '
|
|
set -e
|
|
|
|
echo "West version:"
|
|
west --version
|
|
echo ""
|
|
|
|
# Update west modules if west.yml exists
|
|
if [ -f "west.yml" ]; then
|
|
echo "Updating west modules..."
|
|
west update
|
|
fi
|
|
|
|
# Build for target board
|
|
echo "Starting build..."
|
|
west build -b nrf52840dk_nrf52840 . --pristine
|
|
|
|
echo ""
|
|
echo "=== Build successful ==="
|
|
|
|
# Show build artifacts
|
|
echo ""
|
|
echo "Build artifacts:"
|
|
ls -lh build/zephyr/*.bin 2>/dev/null || true
|
|
ls -lh build/zephyr/*.hex 2>/dev/null || true
|
|
'
|
|
""".trimIndent()
|
|
}
|
|
}
|
|
|
|
triggers {
|
|
vcs {
|
|
branchFilter = "+:*"
|
|
}
|
|
}
|
|
|
|
failureConditions {
|
|
executionTimeoutMin = 45
|
|
}
|
|
|
|
requirements {
|
|
contains("docker.server.osType", "linux")
|
|
}
|
|
})
|