feat: implement versioning and release management in the project
- Added automatic versioning based on git tags using semantic-release in Gitea Actions. - Introduced new API endpoints `GET /version` and `GET /v1/version` to expose build metadata. - Updated Docker build process to include version and build time information in Go binaries. - Enhanced documentation with details on release processes and versioning guidelines. - Integrated version display in the web application for better user visibility.
This commit is contained in:
@@ -19,6 +19,14 @@ variable "SHA_FULL" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "VERSION" {
|
||||
default = "dev"
|
||||
}
|
||||
|
||||
variable "BUILD_TIME" {
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "CACHE_REF_GO" {
|
||||
default = ""
|
||||
}
|
||||
@@ -87,6 +95,11 @@ target "go-build-all" {
|
||||
dockerfile = "deploy/docker/gobinary/Dockerfile"
|
||||
target = "build-all"
|
||||
platforms = ["linux/amd64"]
|
||||
args = {
|
||||
VERSION = VERSION
|
||||
GIT_SHA = notequal("", SHA_FULL) ? SHA_FULL : SHORT_SHA
|
||||
BUILD_TIME = BUILD_TIME
|
||||
}
|
||||
contexts = {
|
||||
deps = "target:go-deps"
|
||||
}
|
||||
@@ -127,14 +140,17 @@ target "_go-runtime-birdc" {
|
||||
|
||||
function "image-tags" {
|
||||
params = [name]
|
||||
result = notequal("", SHA_FULL) ? [
|
||||
"${REGISTRY}/${name}:${IMAGE_TAG}",
|
||||
"${REGISTRY}/${name}:${SHORT_SHA}",
|
||||
"${REGISTRY}/${name}:sha-${SHA_FULL}",
|
||||
] : [
|
||||
"${REGISTRY}/${name}:${IMAGE_TAG}",
|
||||
"${REGISTRY}/${name}:${SHORT_SHA}",
|
||||
]
|
||||
result = concat(
|
||||
notequal("", SHA_FULL) ? [
|
||||
"${REGISTRY}/${name}:${IMAGE_TAG}",
|
||||
"${REGISTRY}/${name}:${SHORT_SHA}",
|
||||
"${REGISTRY}/${name}:sha-${SHA_FULL}",
|
||||
] : [
|
||||
"${REGISTRY}/${name}:${IMAGE_TAG}",
|
||||
"${REGISTRY}/${name}:${SHORT_SHA}",
|
||||
],
|
||||
notequal(VERSION, "dev") && notequal(VERSION, "") ? ["${REGISTRY}/${name}:v${VERSION}"] : []
|
||||
)
|
||||
}
|
||||
|
||||
target "evobgp-api" {
|
||||
|
||||
Reference in New Issue
Block a user