Skip to content

Commit

Permalink
Add build version info to image tags
Browse files Browse the repository at this point in the history
Storage is cheap, and these images are layered correctly, so I think its
worth it for even better reproducibility
  • Loading branch information
NovaFox161 committed Oct 8, 2023
1 parent 521f9b0 commit 4d1cf2b
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
8 changes: 7 additions & 1 deletion cam/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,14 @@ kotlin {

jib {
to {
val buildVersion = if (System.getenv("GITHUB_RUN_NUMBER") != null) {
"$version.b${System.getenv("GITHUB_RUN_NUMBER")}"
} else {
"$version.d${System.currentTimeMillis().div(1000)}" //Seconds since epoch
}

image = "rg.nl-ams.scw.cloud/dreamexposure/discal-cam"
tags = mutableSetOf("latest", version.toString())
tags = mutableSetOf("latest", version.toString(), buildVersion)
}

val baseImage: String by properties
Expand Down
8 changes: 7 additions & 1 deletion client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,14 @@ kotlin {

jib {
to {
val buildVersion = if (System.getenv("GITHUB_RUN_NUMBER") != null) {
"$version.b${System.getenv("GITHUB_RUN_NUMBER")}"
} else {
"$version.d${System.currentTimeMillis().div(1000)}" //Seconds since epoch
}

image = "rg.nl-ams.scw.cloud/dreamexposure/discal-client"
tags = mutableSetOf("latest", version.toString())
tags = mutableSetOf("latest", version.toString(), buildVersion)
}

val baseImage: String by properties
Expand Down
4 changes: 2 additions & 2 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ kotlin {
gitProperties {
extProperty = "gitPropertiesExt"

val versionName = if (System.getenv("GITHUB_RUN_NUMBER") != null) {
val buildVersion = if (System.getenv("GITHUB_RUN_NUMBER") != null) {
"$version.b${System.getenv("GITHUB_RUN_NUMBER")}"
} else {
"$version.d${System.currentTimeMillis().div(1000)}" //Seconds since epoch
}

// Custom git properties for compile-time constants
customProperty("discal.version", versionName)
customProperty("discal.version", buildVersion)
customProperty("discal.version.d4j", discord4jVersion)
}

Expand Down
8 changes: 7 additions & 1 deletion server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ kotlin {

jib {
to {
val buildVersion = if (System.getenv("GITHUB_RUN_NUMBER") != null) {
"$version.b${System.getenv("GITHUB_RUN_NUMBER")}"
} else {
"$version.d${System.currentTimeMillis().div(1000)}" //Seconds since epoch
}

image = "rg.nl-ams.scw.cloud/dreamexposure/discal-server"
tags = mutableSetOf("latest", version.toString())
tags = mutableSetOf("latest", version.toString(), buildVersion)
}

val baseImage: String by properties
Expand Down
8 changes: 7 additions & 1 deletion web/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,14 @@ sourceSets {

jib {
to {
val buildVersion = if (System.getenv("GITHUB_RUN_NUMBER") != null) {
"$version.b${System.getenv("GITHUB_RUN_NUMBER")}"
} else {
"$version.d${System.currentTimeMillis().div(1000)}" //Seconds since epoch
}

image = "rg.nl-ams.scw.cloud/dreamexposure/discal-web"
tags = mutableSetOf("latest", version.toString())
tags = mutableSetOf("latest", version.toString(), buildVersion)
}

val baseImage: String by properties
Expand Down

0 comments on commit 4d1cf2b

Please sign in to comment.