20846: Merge branch 'main' into 20846-ruby3
authorTom Clegg <tom@curii.com>
Wed, 15 Nov 2023 21:05:06 +0000 (16:05 -0500)
committerTom Clegg <tom@curii.com>
Wed, 15 Nov 2023 21:05:06 +0000 (16:05 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

1  2 
lib/install/deps.go

index a5cfe879524b258656a235a22d5a869a062c9a25,500d1ec7b8ff092382b13acb60ad155ba4649c50..7b32984348346b24e4a2106b94dba8a1582bbd8a
@@@ -665,37 -693,15 +678,39 @@@ don
                                return 1
                        }
                }
 +              cmd = exec.Command("sudo", "-u", "www-data", "/var/lib/arvados/bin/bundle", "exec", "passenger-config", "validate-install")
 +              cmd.Dir = "/var/lib/arvados/railsapi"
 +              cmd.Stdout = stdout
 +              cmd.Stderr = stderr
 +              err = cmd.Run()
 +              if err != nil && !strings.Contains(err.Error(), "exit status 2") {
 +                      // Exit code 2 indicates there were warnings (like
 +                      // "other passenger installations have been detected",
 +                      // which we can't expect to avoid) but no errors.
 +                      // Other non-zero exit codes (1, 9) indicate errors.
 +                      return 1
 +              }
  
 -              // Install workbench2 app to /var/lib/arvados/workbench2/
 +              // Install workbench2 app to
 +              // /var/lib/arvados/workbench2/.
 +              //
 +              // We copy the source tree from the (possibly
 +              // readonly) source tree into a temp dir because `yarn
 +              // build` writes to {source-tree}/build/. When we
 +              // upgrade to react-scripts >= 4.0.2 we may be able to
 +              // build from the source dir and write directly to the
 +              // final destination (using
 +              // YARN_INSTALL_STATE_PATH=/dev/null
 +              // BUILD_PATH=/var/lib/arvados/workbench2) instead of
 +              // using two rsync steps here.
                if err = inst.runBash(`
+ src="`+inst.SourcePath+`/services/workbench2"
  tmp=/var/lib/arvados/tmp/workbench2
- rsync -a --delete-after `+inst.SourcePath+`/services/workbench2/ "$tmp/"
- env -C "$tmp" VERSION="`+inst.PackageVersion+`" BUILD_NUMBER=1 GIT_COMMIT=000000000 yarn build
- rsync -a --delete-after "$tmp/build/" /var/lib/arvados/workbench2/
 +trap "rm -r ${tmp}" ERR EXIT
+ dst=/var/lib/arvados/workbench2
+ rsync -a --delete-after "$src/" "$tmp/"
+ env -C "$tmp" VERSION="`+inst.PackageVersion+`" BUILD_NUMBER=1 GIT_COMMIT="`+inst.Commit[:9]+`" yarn build
+ rsync -a --delete-after "$tmp/build/" "$dst/"
  `, stdout, stderr); err != nil {
                        return 1
                }