From dd0a3374d28c0e3d9c59478dec0325d0ba5d1c31 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Mon, 7 Feb 2022 11:16:48 -0800 Subject: [PATCH] Update Gitea to 1.16.4 Gitea 1.16.4 is now available. Note that this update includes the changes from 1.16.0-1.16.3 as well since we are upgrading from 1.15.x. The changelog can be found at: https://github.com/go-gitea/gitea/blob/v1.16.4/CHANGELOG.md In particular this calls out: https://github.com/go-gitea/gitea/pull/17846 as a potentially breaking change that may impact our use of ssh. We attempt to update our Dockerfile to use the correct gitea command script to address this but we should likely test replication before landing this update. The changelog is quite large and I haven't been able to fully examine it for impacts. Reviewers are encouraged to look it over and find items we should address. Additionally once this is reliably building we should hold a node and inspect it directly. Change-Id: I0bf7400d43583a8e8b54581225c70cba53007876 --- docker/gitea/Dockerfile | 19 ++++- .../custom/templates/base/head_navbar.tmpl | 41 +++++----- .../gitea/custom/templates/repo/header.tmpl | 77 ++++++++++++++++--- 3 files changed, 98 insertions(+), 39 deletions(-) diff --git a/docker/gitea/Dockerfile b/docker/gitea/Dockerfile index 65280ee31d..d0ead72a1c 100644 --- a/docker/gitea/Dockerfile +++ b/docker/gitea/Dockerfile @@ -23,11 +23,11 @@ ################################### #Build stage -FROM docker.io/library/golang:1.16-bullseye AS build-env +FROM docker.io/library/golang:1.17-bullseye AS build-env LABEL maintainer="infra-root@openstack.org" -ARG GITEA_VERSION="v1.15.11" +ARG GITEA_VERSION="v1.16.4" ENV TAGS "bindata $TAGS" #Build deps @@ -46,6 +46,17 @@ WORKDIR ${GOPATH}/src/code.gitea.io/gitea RUN if [ -n "${GITEA_VERSION}" ]; then git checkout "${GITEA_VERSION}"; fi \ && make clean-all build +# This is a utility the upstream image builds to translate env vars into +# the app.ini config. We primarily rely on ansible for this instead but +# build an include it anyway to stay in sync with upstream tooling. +RUN go build contrib/environment-to-ini/environment-to-ini.go + +# Make things executable since they aren't all that way in git +RUN chmod 755 gitea \ + environment-to-ini \ + docker/root/usr/bin/entrypoint \ + docker/root/usr/local/bin/gitea + ################################### # Basic system setup common to all containers in our pod @@ -79,7 +90,7 @@ COPY --from=build-env /go/src/code.gitea.io/gitea/docker/root / # Copy the app COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea -RUN ln -s /app/gitea/gitea /usr/local/bin/gitea +COPY --from=build-env /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini # Copy our custom templates COPY custom/ /custom/ @@ -99,7 +110,7 @@ EXPOSE 3000 ENV USER git VOLUME ["/data"] ENTRYPOINT ["/usr/bin/entrypoint"] -CMD ["/app/gitea/gitea", "web"] +CMD ["/usr/local/bin/gitea", "web"] USER 1000:1000 ################################### diff --git a/docker/gitea/custom/templates/base/head_navbar.tmpl b/docker/gitea/custom/templates/base/head_navbar.tmpl index 92dc52a48d..a26d6f9e56 100644 --- a/docker/gitea/custom/templates/base/head_navbar.tmpl +++ b/docker/gitea/custom/templates/base/head_navbar.tmpl @@ -1,6 +1,6 @@