mirror of
https://github.com/chatmail/relay.git
synced 2026-05-21 13:28:05 +00:00
docker: normalize GIT_HASH to full sha, document version files
This commit is contained in:
@@ -5,5 +5,5 @@
|
|||||||
# .git/ is excluded from the build context (.dockerignore) so the hash
|
# .git/ is excluded from the build context (.dockerignore) so the hash
|
||||||
# must be passed as a build arg from the host.
|
# must be passed as a build arg from the host.
|
||||||
|
|
||||||
export GIT_HASH=$(git rev-parse --short HEAD)
|
export GIT_HASH=$(git rev-parse HEAD)
|
||||||
exec docker compose build "$@"
|
exec docker compose build "$@"
|
||||||
|
|||||||
@@ -64,6 +64,9 @@ RUN rm -f /tmp/chatmail.ini
|
|||||||
# Record image version (used in deploy fingerprint at runtime).
|
# Record image version (used in deploy fingerprint at runtime).
|
||||||
# GIT_HASH is passed as a build arg (from docker-compose or CI) so that
|
# GIT_HASH is passed as a build arg (from docker-compose or CI) so that
|
||||||
# .git/ can be excluded from the build context via .dockerignore.
|
# .git/ can be excluded from the build context via .dockerignore.
|
||||||
|
# Two files: chatmail-image-version is the immutable build hash (survives
|
||||||
|
# deploys); chatmail-version is overwritten by cmdeploy run and restored
|
||||||
|
# from the image version after each deploy in chatmail-init.sh.
|
||||||
ARG GIT_HASH=unknown
|
ARG GIT_HASH=unknown
|
||||||
RUN echo "$GIT_HASH" > /etc/chatmail-image-version && \
|
RUN echo "$GIT_HASH" > /etc/chatmail-image-version && \
|
||||||
echo "$GIT_HASH" > /etc/chatmail-version
|
echo "$GIT_HASH" > /etc/chatmail-version
|
||||||
|
|||||||
Reference in New Issue
Block a user