16552: Add arvados-cli gem to arvados-server-easy package.
authorTom Clegg <tom@curii.com>
Thu, 30 Jun 2022 15:44:52 +0000 (11:44 -0400)
committerTom Clegg <tom@curii.com>
Thu, 30 Jun 2022 19:02:15 +0000 (15:02 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

cmd/arvados-package/fpm.go
lib/install/deps.go

index 4c9a00619e7e15cb328e381c4a6967196fb89d9c..9a20ec76fc5c8058423403ed9e6af6d9c7517b62 100644 (file)
@@ -104,6 +104,8 @@ func fpm(ctx context.Context, opts opts, stdin io.Reader, stdout, stderr io.Writ
                "/lib/systemd/system/arvados.service",
                "/usr/bin/arvados-client",
                "/usr/bin/arvados-server",
+               "/usr/bin/arv",
+               "/usr/bin/arv-tag",
                "/var/lib/arvados",
                "/var/www/.gem",
                "/var/www/.passenger",
index caecdd017d66684a9cc99969bb033b42ed835d16..017771b637bb9897aab14ce7a234098c77d48be5 100644 (file)
@@ -578,19 +578,6 @@ yarn install
                        }
                }
 
-               // Symlink user-facing Go programs /usr/bin/x ->
-               // /var/lib/arvados/bin/x
-               for _, prog := range []string{"arvados-client", "arvados-server"} {
-                       err = os.Remove("/usr/bin/" + prog)
-                       if err != nil && !errors.Is(err, os.ErrNotExist) {
-                               return 1
-                       }
-                       err = os.Symlink("/var/lib/arvados/bin/"+prog, "/usr/bin/"+prog)
-                       if err != nil {
-                               return 1
-                       }
-               }
-
                // Copy assets from source tree to /var/lib/arvados/share
                cmd := exec.Command("install", "-v", "-t", "/var/lib/arvados/share", filepath.Join(inst.SourcePath, "sdk/python/tests/nginx.conf"))
                cmd.Stdout = stdout
@@ -676,6 +663,14 @@ rsync -a --delete-after build/ /var/lib/arvados/workbench2/
                        return 1
                }
 
+               // Install arvados-cli gem (binaries go in
+               // /var/lib/arvados/bin)
+               if err = inst.runBash(`
+/var/lib/arvados/bin/gem install --conservative --no-document arvados-cli
+`, stdout, stderr); err != nil {
+                       return 1
+               }
+
                err = os.WriteFile("/lib/systemd/system/arvados.service", arvadosServiceFile, 0777)
                if err != nil {
                        return 1
@@ -692,6 +687,19 @@ rsync -a --delete-after build/ /var/lib/arvados/workbench2/
                if err != nil {
                        return 1
                }
+
+               // Symlink user-facing programs /usr/bin/x ->
+               // /var/lib/arvados/bin/x
+               for _, prog := range []string{"arvados-client", "arvados-server", "arv", "arv-tag"} {
+                       err = os.Remove("/usr/bin/" + prog)
+                       if err != nil && !errors.Is(err, os.ErrNotExist) {
+                               return 1
+                       }
+                       err = os.Symlink("/var/lib/arvados/bin/"+prog, "/usr/bin/"+prog)
+                       if err != nil {
+                               return 1
+                       }
+               }
        }
 
        return 0