Record git revision in build and update deploy Makefile
This commit is contained in:
parent
7fff0a6dbf
commit
81b87f2cc3
2 changed files with 12 additions and 7 deletions
|
|
@ -5,6 +5,7 @@
|
||||||
ARG RUBY_VERSION=3.4.7
|
ARG RUBY_VERSION=3.4.7
|
||||||
ARG NODE_VERSION=22.16.0
|
ARG NODE_VERSION=22.16.0
|
||||||
ARG BUN_VERSION=1.3.9
|
ARG BUN_VERSION=1.3.9
|
||||||
|
ARG GIT_REV=unknown
|
||||||
|
|
||||||
# --- Stage 1: Grab Node.js Binaries ---
|
# --- Stage 1: Grab Node.js Binaries ---
|
||||||
# We use the official image as a source for pre-compiled binaries
|
# We use the official image as a source for pre-compiled binaries
|
||||||
|
|
@ -78,8 +79,11 @@ RUN groupadd --system --gid 1000 rails && \
|
||||||
useradd rails --uid 1000 --gid 1000 --create-home --shell /bin/bash && \
|
useradd rails --uid 1000 --gid 1000 --create-home --shell /bin/bash && \
|
||||||
chown -R rails:rails db log tmp public
|
chown -R rails:rails db log tmp public
|
||||||
|
|
||||||
# Create versioninfo with build timestamp
|
# Redeclare so it is in scope in this final stage
|
||||||
RUN date +"%Y-%m-%d %H:%M:%S %Z" > public/versioninfo
|
ARG GIT_REV=unknown
|
||||||
|
|
||||||
|
# Create versioninfo with git revision and build timestamp
|
||||||
|
RUN printf 'git-rev: %s\nbuilt-at: %s\n' "$GIT_REV" "$(date +'%Y-%m-%d %H:%M:%S %Z')" > public/versioninfo
|
||||||
|
|
||||||
USER 1000:1000
|
USER 1000:1000
|
||||||
|
|
||||||
|
|
|
||||||
11
Makefile
11
Makefile
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
-include .env.production .env.development
|
-include .env.production .env.development
|
||||||
|
|
||||||
REGISTRY := registry.coolify1.workaround.org
|
REGISTRY := git.workaround.org/chaas
|
||||||
|
|
||||||
stage: TAG=stage
|
stage: TAG=latest
|
||||||
stage: build tag push
|
stage: build tag push
|
||||||
curl -s -H "Authorization: Bearer $(COOLIFY_STAGE_DEPLOY_TOKEN)" \
|
curl -s -H "Authorization: Bearer $(COOLIFY_STAGE_DEPLOY_TOKEN)" \
|
||||||
-X POST "$(COOLIFY_STAGE_DEPLOY_WEBHOOK)"
|
-X POST "$(COOLIFY_STAGE_DEPLOY_WEBHOOK)"
|
||||||
|
|
@ -15,10 +15,11 @@ prod: build tag push
|
||||||
-X POST "$(COOLIFY_PROD_DEPLOY_WEBHOOK)"
|
-X POST "$(COOLIFY_PROD_DEPLOY_WEBHOOK)"
|
||||||
|
|
||||||
build:
|
build:
|
||||||
podman build -t debshots-$(TAG) .
|
docker build --build-arg GIT_REV=$(git rev-parse --short HEAD) -t debshots-$(TAG) .
|
||||||
|
|
||||||
tag:
|
tag:
|
||||||
podman tag debshots-$(TAG) $(REGISTRY)/debshots-web:$(TAG)
|
docker tag debshots-$(TAG) $(REGISTRY)/debshots:$(TAG)
|
||||||
|
|
||||||
push:
|
push:
|
||||||
podman push $(REGISTRY)/debshots-web:$(TAG)
|
docker push $(REGISTRY)/debshots:$(TAG)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue