Escape and lowercase variables

This commit is contained in:
Manuel 2023-09-12 22:31:57 +02:00
parent 96ff13057f
commit 35aa9ed7fa
Signed by: SunRed
GPG Key ID: 4085037435E1F07A
5 changed files with 9 additions and 9 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
/config.toml
/compose.yml
/target
/$REPO_NAME
/$REPO_NAME_LOWER

View File

@ -3,7 +3,7 @@ name = "${REPO_NAME}"
version = "0.1.0"
authors = ["Manuel <git@huesers.de>"]
description = "${REPO_DESCRIPTION}"
homepage = "${REPO_LINK}"
homepage = "https://git.snrd.eu/${REPO_OWNER_LOWER}/${REPO_NAME_LOWER}"
repository = "${REPO_HTTPS_URL}"
keywords = []
edition = "2021"

View File

@ -9,8 +9,8 @@ RUN cargo install --path . -j $(nproc)
FROM alpine:latest
COPY --from=build /usr/local/cargo/bin/$REPO_NAME /app/$REPO_NAME
COPY --from=build /usr/local/cargo/bin/$REPO_NAME_LOWER /app/$REPO_NAME_LOWER
WORKDIR /app
RUN apk add --no-cache libgcc
CMD ["./${REPO_NAME}"]
CMD ["./${REPO_NAME_LOWER}"]

View File

@ -1,10 +1,10 @@
services:
$REPO_NAME:
$REPO_NAME_LOWER:
build:
context: .
dockerfile: Dockerfile
image: git.snrd.eu/$REPO_OWNER/$REPO_NAME:latest
container_name: $REPO_NAME
image: git.snrd.eu/$REPO_OWNER_LOWER/$REPO_NAME_LOWER:latest
container_name: $REPO_NAME_LOWER
network_mode: bridge
volumes:
- ./config.toml:/app/config.toml:ro

View File

@ -2,7 +2,7 @@ variable "REG" {
default = "git.snrd.eu"
}
variable "REPO" {
default = "${REPO_OWNER}/${REPO_NAME}"
default = "${REPO_OWNER_LOWER}/${REPO_NAME_LOWER}"
}
variable "TAG" {
default = "latest"
@ -14,7 +14,7 @@ group "default" {
target "default" {
#platforms = [ "linux/amd64", "linux/arm64", "linux/arm/v7", "linux/riscv64" ]
tags = ["${REG}/${REPO}:latest", "${REG}/${REPO}:${TAG}"]
tags = ["$${REG}/$${REPO}:latest", "$${REG}/$${REPO}:$${TAG}"]
attest = [
"type=provenance,disabled=true",
"type=sbom,disabled=true"