-
Notifications
You must be signed in to change notification settings - Fork 0
/
.space.kts
31 lines (29 loc) · 1.04 KB
/
.space.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* JetBrains Space Automation
* This Kotlin-script file lets you automate build activities
* For more info, see https://www.jetbrains.com/help/space/automation.html
*/
job("Build and push phantasus-preimage") {
docker {
beforeBuildScript {
// Create an env variable BRANCH,
// use env var to get full branch name,
// leave only the branch name without the 'refs/heads/' path
content = """
export BRANCH=${'$'}(echo ${'$'}JB_SPACE_GIT_BRANCH | cut -d'/' -f 3)
case ${'$'}BRANCH in
"master") export LATEST="latest" ;;
*) export LATEST="test" ;;
esac
"""
}
build {
file = "Dockerfile"
labels["vendor"] = "ctlab"
}
push("ctlab.registry.jetbrains.space/p/phantasus/phantasus-containers/phantasus-preimage") {
// use current job run number and branch name as a tag - '0.run_number-branch_name'
tags("0.\$JB_SPACE_EXECUTION_NUMBER-\$BRANCH", "\$LATEST")
}
}
}