diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-03-01 10:30:32 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-03-01 10:30:32 +0300 |
commit | e98645fb8603ad6442458d1df6874f253326a80c (patch) | |
tree | 1213af2ef2fb60e00f266077ee09e0c4cea5eb73 | |
parent | 87cd55c5509d42a1d9fd82788b38c386c8d1788b (diff) |
git: Support version suffixes for bundled Git environments
While we only have a single bundled Git environment right now, the plan
is to extend support such that we can have multiple bundled environments
at the same time which are then feature-flaggable. The different sets of
binaries can be distinguished by their version suffix: while the current
set of binaries is simply called "gitaly-git" et al, we already have a
second version which installs as "gitaly-git-v2.35.1.gl1".
Allow bundled Git execution environments to specify version suffixes
such that it's easily possible to set up multiple ones.
-rw-r--r-- | internal/git/execution_environment.go | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/internal/git/execution_environment.go b/internal/git/execution_environment.go index 287584de3..a85ea9952 100644 --- a/internal/git/execution_environment.go +++ b/internal/git/execution_environment.go @@ -182,16 +182,18 @@ func (c BundledGitEnvironmentConstructor) Construct(cfg config.Cfg) (_ Execution }() for executable, target := range map[string]string{ - "git": "gitaly-git" + c.Suffix, - "git-receive-pack": "gitaly-git" + c.Suffix, - "git-upload-pack": "gitaly-git" + c.Suffix, - "git-upload-archive": "gitaly-git" + c.Suffix, - "git-http-backend": "gitaly-git-http-backend" + c.Suffix, - "git-remote-http": "gitaly-git-remote-http" + c.Suffix, - "git-remote-https": "gitaly-git-remote-http" + c.Suffix, - "git-remote-ftp": "gitaly-git-remote-http" + c.Suffix, - "git-remote-ftps": "gitaly-git-remote-http" + c.Suffix, + "git": "gitaly-git", + "git-receive-pack": "gitaly-git", + "git-upload-pack": "gitaly-git", + "git-upload-archive": "gitaly-git", + "git-http-backend": "gitaly-git-http-backend", + "git-remote-http": "gitaly-git-remote-http", + "git-remote-https": "gitaly-git-remote-http", + "git-remote-ftp": "gitaly-git-remote-http", + "git-remote-ftps": "gitaly-git-remote-http", } { + target := target + c.Suffix + if err := os.Symlink( filepath.Join(cfg.BinDir, target), filepath.Join(gitExecPath, executable), |