Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@ RUN pip install --upgrade pip
# - imagemagick: Image processing for thumbnails and conversions
# - ghostscript: PDF processing (required by imagemagick for PDFs)
# - sqlite3: Useful for debugging, though we use PostgreSQL in production
# - git: lets docker-entrypoint.sh capture the deployed commit SHA into
# build-info.json for the /version/ endpoint (#1366)
#
# We clean up the apt cache afterward to reduce the final image size.
RUN apt-get update \
&& apt-get --assume-yes install --no-install-recommends \
imagemagick \
ghostscript \
sqlite3 \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
7 changes: 6 additions & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,15 @@ echo ""
# capture the short SHA + a timestamp ONCE here (not per request) into a small
# build-info.json that website/views/version.py reads. Falls back to "unknown"
# if git isn't available (the view also tolerates a missing file).
#
# On the servers /code is a bind-mount whose .git is owned by apache:makelab
# while this script runs as root, so git's "dubious ownership" guard would
# otherwise refuse to run -- mark /code safe first (-c is process-local, no
# global config side effects). git is installed in the Dockerfile.
echo "****************** STEP -1/5: docker-entrypoint.sh ************************"
echo "-1. Writing build-info.json (git sha + build timestamp) for /version/"
echo "******************************************"
GIT_SHA=$(git rev-parse --short HEAD 2>/dev/null || echo "unknown")
GIT_SHA=$(git -c safe.directory=/code -C /code rev-parse --short HEAD 2>/dev/null || echo "unknown")
BUILT_AT=$(date --iso-8601=seconds 2>/dev/null || echo "unknown")
printf '{"git_sha": "%s", "built_at": "%s"}\n' "$GIT_SHA" "$BUILT_AT" > build-info.json
cat build-info.json
Expand Down
4 changes: 2 additions & 2 deletions makeabilitylab/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

# Makeability Lab Global Variables, including Makeability Lab version
ML_WEBSITE_VERSION = "2.17.1" # Keep this updated with each release and also change the short description below
ML_WEBSITE_VERSION_DESCRIPTION = "Add an admin Data Health check, 'Artifacts not linked to a project' (/admin/data-health/), that surfaces every talk, paper, video, and poster with no project assigned so the backlog stays visible and shrinks over time. Pre-Makeability-Lab work (before settings.DATE_MAKEABILITYLAB_FORMED) is excluded, rows whose parent publication is already linked are flagged as quick wins (inherit its projects), and each row deep-links to its admin edit page. Read-only with CSV export. Also keeps data-health row-action buttons from wrapping mid-word in narrow columns (#649)."
ML_WEBSITE_VERSION = "2.17.2" # Keep this updated with each release and also change the short description below
ML_WEBSITE_VERSION_DESCRIPTION = "Fix the /version/ endpoint reporting git_sha and built_at as 'unknown' in deployed environments. The build-info capture in docker-entrypoint.sh needs git (it wasn't installed in the image) and trips git's 'dubious ownership' guard because /code/.git is apache:makelab-owned while the container runs as root. Installs git in the Dockerfile and runs rev-parse with -c safe.directory=/code. The Dockerfile change also forces an image rebuild on deploy, so the entrypoint actually re-runs and writes build-info.json (#1366)."
DATE_MAKEABILITYLAB_FORMED = datetime.date(2012, 1, 1) # Date Makeability Lab was formed
MAX_BANNERS = 7 # Maximum number of banners on a page

Expand Down
Loading