← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~twom/lpbuildbot-worker:ensure-database-user-exists into lpbuildbot-worker:main

 

Tom Wardill has proposed merging ~twom/lpbuildbot-worker:ensure-database-user-exists into lpbuildbot-worker:main.

Commit message:
Ensure the database user exists

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~twom/lpbuildbot-worker/+git/lpbuildbot-worker/+merge/390698
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~twom/lpbuildbot-worker:ensure-database-user-exists into lpbuildbot-worker:main.
diff --git a/lp-setup-lxd-build b/lp-setup-lxd-build
index ba2d386..4eee30f 100755
--- a/lp-setup-lxd-build
+++ b/lp-setup-lxd-build
@@ -102,6 +102,15 @@ def build_launchpad_in_container(container, work_dir):
     print("Building Launchpad in container", flush=True)
     for build_step in BUILD_STEPS:
         print("Build step: {}".format(build_step), flush=True)
+        if build_step == "schema":
+            # Ensure the database user exists
+            print("Configuring database")
+            _exec(
+                container,
+                ["./utilities/launchpad-database-setup", "buildbot"],
+                user="buildbot",
+                cwd="{}/devel".format(work_dir),
+            )
         _exec(
             container,
             ["make", build_step],