user: "www-data",
}, "arvados-server", "workbench2", super.cluster.Services.Controller.ExternalURL.Host, net.JoinHostPort(host, port), ".")
} else {
- stdinr, stdinw := io.Pipe()
- defer stdinw.Close()
- go func() {
- <-ctx.Done()
- stdinw.Close()
- }()
- if err = os.Mkdir(super.SourcePath+"/services/workbench2/public/_health", 0777); err != nil && !errors.Is(err, fs.ErrExist) {
+ // super.SourcePath might be readonly, so for
+ // dev/test mode we make a copy in a writable
+ // dir.
+ livedir := super.wwwtempdir + "/workbench2"
+ if err := super.RunProgram(ctx, super.SourcePath+"/services/workbench2", runOptions{}, "rsync", "-a", "--delete-after", super.SourcePath+"/services/workbench2/", livedir); err != nil {
+ fail(err)
+ return
+ }
+ if err = os.Mkdir(livedir+"/public/_health", 0777); err != nil && !errors.Is(err, fs.ErrExist) {
fail(err)
return
}
- if err = ioutil.WriteFile(super.SourcePath+"/services/workbench2/public/_health/ping", []byte(`{"health":"OK"}`), 0666); err != nil {
+ if err = ioutil.WriteFile(livedir+"/public/_health/ping", []byte(`{"health":"OK"}`), 0666); err != nil {
fail(err)
return
}
- err = super.RunProgram(ctx, super.SourcePath+"/services/workbench2", runOptions{
+
+ stdinr, stdinw := io.Pipe()
+ defer stdinw.Close()
+ go func() {
+ <-ctx.Done()
+ stdinw.Close()
+ }()
+ err = super.RunProgram(ctx, livedir, runOptions{
env: []string{
"CI=true",
"HTTPS=false",
// Install workbench2 app to /var/lib/arvados/workbench2/
if err = inst.runBash(`
-cd "`+inst.SourcePath+`/services/workbench2"
-VERSION="`+inst.PackageVersion+`" BUILD_NUMBER=1 GIT_COMMIT="`+inst.Commit[:9]+`" yarn build
-rsync -a --delete-after build/ /var/lib/arvados/workbench2/
+src="`+inst.SourcePath+`/services/workbench2"
+tmp=/var/lib/arvados/tmp/workbench2
+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
}