From 5f778e6945d8c3c216922f9aa1f45253a1c62376 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Wed, 15 Nov 2023 16:51:43 -0500 Subject: [PATCH] 20846: Add -bundler-version option to arvados-server install. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- lib/install/deps.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/install/deps.go b/lib/install/deps.go index 9f4af1317f..998da1200c 100644 --- a/lib/install/deps.go +++ b/lib/install/deps.go @@ -35,7 +35,7 @@ const goversion = "1.20.6" const ( defaultRubyVersion = "3.2.2" - bundlerversion = "2.2.19" + defaultBundlerVersion = "2.2.19" singularityversion = "3.10.4" pjsversion = "1.9.8" geckoversion = "0.24.0" @@ -53,6 +53,7 @@ type installCommand struct { Commit string PackageVersion string RubyVersion string + BundlerVersion string EatMyData bool } @@ -77,6 +78,7 @@ func (inst *installCommand) RunCommand(prog string, args []string, stdin io.Read flags.StringVar(&inst.Commit, "commit", "", "source commit `hash` to embed (blank means use 'git log' or all-zero placeholder)") flags.StringVar(&inst.PackageVersion, "package-version", "0.0.0", "version string to embed in executable files") flags.StringVar(&inst.RubyVersion, "ruby-version", defaultRubyVersion, "Ruby `version` to install (do not override in production mode)") + flags.StringVar(&inst.BundlerVersion, "bundler-version", defaultBundlerVersion, "Bundler `version` to install (do not override in production mode)") flags.BoolVar(&inst.EatMyData, "eatmydata", false, "use eatmydata to speed up install") if ok, code := cmd.ParseFlags(flags, prog, args, "", stderr); !ok { @@ -117,6 +119,10 @@ func (inst *installCommand) RunCommand(prog string, args []string, stdin io.Read fmt.Fprintf(stderr, "invalid argument %q for -ruby-version\n", inst.RubyVersion) return 64 } + if ok, _ := regexp.MatchString(`^\d`, inst.BundlerVersion); !ok { + fmt.Fprintf(stderr, "invalid argument %q for -bundler-version\n", inst.BundlerVersion) + return 64 + } osv, err := identifyOS() if err != nil { @@ -661,7 +667,7 @@ done {"mkdir", "-p", "log", "public/assets", "tmp", "vendor", ".bundle", "/var/www/.bundle", "/var/www/.gem", "/var/www/.npm", "/var/www/.passenger"}, {"touch", "log/production.log"}, {"chown", "-R", "--from=root", "www-data:www-data", "/var/www/.bundle", "/var/www/.gem", "/var/www/.npm", "/var/www/.passenger", "log", "tmp", "vendor", ".bundle", "Gemfile.lock", "config.ru", "config/environment.rb"}, - {"sudo", "-u", "www-data", "/var/lib/arvados/bin/gem", "install", "--user", "--conservative", "--no-document", "bundler:" + bundlerversion}, + {"sudo", "-u", "www-data", "/var/lib/arvados/bin/gem", "install", "--user", "--conservative", "--no-document", "bundler:" + inst.BundlerVersion}, {"sudo", "-u", "www-data", "/var/lib/arvados/bin/bundle", "config", "set", "--local", "deployment", "true"}, {"sudo", "-u", "www-data", "/var/lib/arvados/bin/bundle", "config", "set", "--local", "path", "/var/www/.gem"}, {"sudo", "-u", "www-data", "/var/lib/arvados/bin/bundle", "config", "set", "--local", "without", "development test diagnostics performance"}, -- 2.30.2