Use global gitlab variable versions
This commit is contained in:
parent
e9409a153d
commit
fcd007d7be
3 changed files with 23 additions and 23 deletions
|
@ -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"'
|
||||
|
|
14
Dockerfile
14
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
|
||||
|
|
24
compose.yml
24
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/
|
||||
|
|
Loading…
Reference in a new issue