forked from SunRed/discord-tweeter
* Update golang version to 1.24 * Update multiarch Dockerfile to be more ISA agnostic * Refactor existing code and properly structure project into modules * Get rid of global variables except where necessary (go:embed) * Add default values to Config * Add webserver with templates to finally correctly serve videos and gifs * Add tiny caching library to decrease api load and improve latency * Improve Webhook data preparation by filtering out redundant links from the tweet text and properly attaching videos and gifs in separate webhook request by utilising new webserver * Improve tests for filter function * Improve bake definition for easier CI integration
44 lines
928 B
HCL
44 lines
928 B
HCL
variable "IMAGE" {
|
|
default = "git.snrd.eu/sunred/discord-tweeter"
|
|
}
|
|
variable "TAG" {
|
|
default = "latest"
|
|
}
|
|
|
|
function "generate_tags" {
|
|
params = [images, versions]
|
|
result = distinct(flatten(
|
|
[for i in split(",", images) :
|
|
[for v in split(",", versions) :
|
|
"${i}:${v}"
|
|
]
|
|
]))
|
|
}
|
|
|
|
group "default" {
|
|
targets = ["prod"]
|
|
}
|
|
|
|
target "default" {
|
|
tags = generate_tags(IMAGE, TAG)
|
|
}
|
|
target "prod" {
|
|
inherits = ["default"]
|
|
//platforms = ["linux/amd64", "linux/arm64", "linux/arm/v7", "linux/riscv64"]
|
|
platforms = ["linux/amd64", "linux/arm64"]
|
|
dockerfile = "Dockerfile.multiarch"
|
|
output = ["type=registry"]
|
|
attest = [
|
|
{ type = "provenance", mode = "max" },
|
|
{ type = "sbom" }
|
|
]
|
|
}
|
|
target "dev" {
|
|
inherits = ["default"]
|
|
dockerfile = "Dockerfile"
|
|
output = ["type=docker"]
|
|
attest = [
|
|
{ type = "provenance", disabled = "true" },
|
|
{ type = "sbom", disabled = "true" }
|
|
]
|
|
}
|