From 35aa9ed7fae33df806eaed384ab78220c5c59434 Mon Sep 17 00:00:00 2001 From: Manuel Date: Tue, 12 Sep 2023 22:31:57 +0200 Subject: [PATCH] Escape and lowercase variables --- .gitignore | 2 +- Cargo.toml | 2 +- Dockerfile | 4 ++-- compose.example.yml | 6 +++--- docker-bake.hcl | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index ddfc535..201ecd1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /config.toml /compose.yml /target -/$REPO_NAME +/$REPO_NAME_LOWER diff --git a/Cargo.toml b/Cargo.toml index f6464d7..fc190a2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "${REPO_NAME}" version = "0.1.0" authors = ["Manuel "] description = "${REPO_DESCRIPTION}" -homepage = "${REPO_LINK}" +homepage = "https://git.snrd.eu/${REPO_OWNER_LOWER}/${REPO_NAME_LOWER}" repository = "${REPO_HTTPS_URL}" keywords = [] edition = "2021" diff --git a/Dockerfile b/Dockerfile index e245647..49f11e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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}"] diff --git a/compose.example.yml b/compose.example.yml index 1aff6af..78d22a9 100644 --- a/compose.example.yml +++ b/compose.example.yml @@ -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 diff --git a/docker-bake.hcl b/docker-bake.hcl index 530e3d8..04309d6 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -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"