diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f28d93d..0d02158 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ variables: LATEST_IMAGE: '$CI_REGISTRY_IMAGE:latest' PRODUCTION_URL: 'https://home.unjx.de' -image: docker:$DOCKER_VERSION-git +image: docker:$V_DOCKER-git .auth_gitlab: before_script: @@ -37,7 +37,7 @@ build: deploy: rules: !reference [.rules:deploy, rules] stage: deploy - image: debian:${DEBIAN_VERSION}-slim + image: debian:${V_DEBIAN}-slim id_tokens: TBOT_GITLAB_JWT: aud: tp.unjx.de @@ -45,8 +45,8 @@ deploy: - apt-get update && apt-get install curl -y - cp tbot.yaml /tmp - cd /tmp - - 'curl -O https://cdn.teleport.dev/teleport-v${TELEPORT_VERSION}-linux-amd64-bin.tar.gz' - - tar -xvf teleport-v${TELEPORT_VERSION}-linux-amd64-bin.tar.gz + - 'curl -O https://cdn.teleport.dev/teleport-v${V_TELEPORT}-linux-amd64-bin.tar.gz' + - tar -xvf teleport-v${V_TELEPORT}-linux-amd64-bin.tar.gz - ./teleport/install - 'tbot start -c tbot.yaml' - 'tsh -i /tmp/machine-id/identity --proxy tp.unjx.de:443 ssh gitlab@berg "docker compose -f /opt/docker/home/compose.yml up home -d --pull always && docker system prune --force"' diff --git a/Dockerfile b/Dockerfile index a7d99dc..562251a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -ARG GOLANG_VERSION -ARG NODE_VERSION -ARG ALPINE_VERSION -FROM golang:${GOLANG_VERSION}-alpine AS goBuilder +ARG V_GOLANG +ARG V_NODE +ARG V_ALPINE +FROM golang:${V_GOLANG}-alpine AS goBuilder WORKDIR /app RUN go install github.com/a-h/templ/cmd/templ@latest @@ -14,7 +14,7 @@ COPY . . RUN templ generate RUN go build -ldflags="-s -w" -o godash main.go -FROM node:${NODE_VERSION}-alpine AS nodeBuilder +FROM node:${V_NODE}-alpine AS nodeBuilder WORKDIR /app COPY package.json yarn.lock ./ @@ -26,12 +26,12 @@ COPY views ./views COPY tailwind.config.js . RUN yarn run tw:build -FROM alpine:${ALPINE_VERSION} AS logo +FROM alpine:${V_ALPINE} AS logo WORKDIR /app RUN apk add figlet RUN figlet GoDash > logo.txt -FROM alpine:${ALPINE_VERSION} AS final +FROM alpine:${V_ALPINE} AS final WORKDIR /app RUN apk add tzdata diff --git a/compose.yml b/compose.yml index 0959ecf..97ffedd 100644 --- a/compose.yml +++ b/compose.yml @@ -6,17 +6,17 @@ services: context: . dockerfile: Dockerfile args: - - GOLANG_VERSION=${GOLANG_VERSION} - - NODE_VERSION=${NODE_VERSION} - - ALPINE_VERSION=${ALPINE_VERSION} + - V_GOLANG=${V_GOLANG} + - V_NODE=${V_NODE} + - V_ALPINE=${V_ALPINE} - APP_VERSION=${CI_COMMIT_TAG} backend: build: context: . dockerfile_inline: | - ARG GOLANG_VERSION - FROM golang:${GOLANG_VERSION}-alpine + ARG V_GOLANG + FROM golang:${V_GOLANG}-alpine RUN apk update && \ apk upgrade && \ apk add tzdata @@ -29,7 +29,7 @@ services: COPY go.sum . RUN go mod download args: - - GOLANG_VERSION=${GOLANG_VERSION} + - V_GOLANG=${V_GOLANG} command: air -c .air.toml environment: - TZ=Europe/Berlin @@ -46,19 +46,19 @@ services: build: context: . dockerfile_inline: | - ARG GOLANG_VERSION - FROM golang:${GOLANG_VERSION}-alpine + ARG V_GOLANG + FROM golang:${V_GOLANG}-alpine RUN go install github.com/a-h/templ/cmd/templ@latest args: - - GOLANG_VERSION=${GOLANG_VERSION} + - V_GOLANG=${V_GOLANG} working_dir: /app command: templ generate --watch volumes: - .:/app/ tailwind: - image: node:${NODE_VERSION}-alpine + image: node:${V_NODE}-alpine working_dir: /app command: yarn tw:dev tty: true @@ -67,14 +67,14 @@ services: golang: profiles: [install] - image: golang:${GOLANG_VERSION}-alpine + image: golang:${V_GOLANG}-alpine working_dir: /app volumes: - .:/app/ node: profiles: [install] - image: node:${NODE_VERSION}-alpine + image: node:${V_NODE}-alpine working_dir: /app volumes: - .:/app/