diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-10-26 15:54:57 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-10-27 10:38:02 +0300 |
commit | 2eb1444c2d063e8d0f214cccdde83a523e3077a9 (patch) | |
tree | 69ebd751e003930fff79fcd43ed578cafdb05d04 /Makefile | |
parent | 441a27bdd78881b619e2bfbd6acb74abc459fd66 (diff) |
ci: Use default Git version provided by Gitaly
Even though the default version of Git is nowadays specified by our
Makefile and built ad-hoc, we still specify the same default version in
our CI instructions. This is needless effort, and sure enough we have
already diverged in that CI uses Git v2.31.0 while the default version
is Git v2.31.1.
With the recent change to interpret an empty GIT_VERSION to mean the
default version we can fix this though: in theory, we could just set the
GIT_VERSION to the empty string by default in our CI instructions and
then we'd automatically get the default Git version. It's a bit unhandy
though given that we'd now end up with weird cache and artifact names
because the Git version is embedded in their names. Instead, introduce
another way to request the default Git version which is to pass
GIT_VERSION=default.
While at it, this commit fixes another bug with setting the Git version:
while we correctly handle the case where the Git version is passed via
environment variables and tweak it accordingly, this doesn't work when
invoking `make GIT_VERSION=default`. This is because by default, make(1)
does not assign to variables which have been explicitly defined by the
user. This issue is fixed by adding an explicit `override` directive.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -83,12 +83,14 @@ PROTOC_GEN_GO_GRPC_VERSION?= 1.1.0 GIT2GO_VERSION ?= v32 LIBGIT2_VERSION ?= v1.2.0 -# Support both vX.Y.Z and X.Y.Z version patterns, since callers across -# GitLab use both. -ifeq ($(GIT_VERSION),) - GIT_VERSION := v2.33.1 +# The default version is used in case the caller does not set the variable or +# if it is either set to the empty string or "default". +ifeq (${GIT_VERSION:default=},) + override GIT_VERSION := v2.33.1 else - GIT_VERSION := $(shell echo ${GIT_VERSION} | awk '/^[0-9]\.[0-9]+\.[0-9]+$$/ { printf "v" } { print $$1 }') + # Support both vX.Y.Z and X.Y.Z version patterns, since callers across GitLab + # use both. + override GIT_VERSION := $(shell echo ${GIT_VERSION} | awk '/^[0-9]\.[0-9]+\.[0-9]+$$/ { printf "v" } { print $$1 }') endif # Dependency downloads @@ -106,7 +108,7 @@ GIT_INSTALL_DIR := ${DEPENDENCY_DIR}/git/install GIT_SOURCE_DIR := ${DEPENDENCY_DIR}/git/source GIT_QUIET := ifeq (${Q},@) - GIT_QUIET = --quiet + GIT_QUIET = --quiet endif ifeq ($(origin GIT_PATCHES),undefined) |