← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~ines-almeida/launchpad:update-ppa-charms-configuration into launchpad:master

 

Ines Almeida has proposed merging ~ines-almeida/launchpad:update-ppa-charms-configuration into launchpad:master.

Commit message:
Update PPA charms to allow setting the PPA domain

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~ines-almeida/launchpad/+git/launchpad/+merge/450161

This will be useful for setting a different PPA domain for qastaging, for example. We want to set it to  `qastaging.content.paddev.net` instead of the general domain `qastaging.paddev.net`
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~ines-almeida/launchpad:update-ppa-charms-configuration into launchpad:master.
diff --git a/charm/launchpad-ppa-publisher/config.yaml b/charm/launchpad-ppa-publisher/config.yaml
index 6c40160..add69b6 100644
--- a/charm/launchpad-ppa-publisher/config.yaml
+++ b/charm/launchpad-ppa-publisher/config.yaml
@@ -3,6 +3,10 @@ options:
     type: boolean
     default: true
     description: If true, enable jobs that may change the database.
+  domain_base:
+    type: string
+    default: launchpad.test
+    description: Base domain for PPA requests.
   domain_alternate:
     type: string
     default:
diff --git a/charm/launchpad-ppa-publisher/reactive/launchpad-ppa-publisher.py b/charm/launchpad-ppa-publisher/reactive/launchpad-ppa-publisher.py
index 89a4445..77cfcfd 100644
--- a/charm/launchpad-ppa-publisher/reactive/launchpad-ppa-publisher.py
+++ b/charm/launchpad-ppa-publisher/reactive/launchpad-ppa-publisher.py
@@ -132,7 +132,9 @@ def configure_apache_website():
     config["ppa_archive_root"] = ppa_archive_root()
     config["ppa_archive_private_root"] = ppa_archive_private()
 
-    domain = config["domain"]
+    # We allow `domain_base` to be set different from the usual `domain`
+    # This might be useful in some environments where we want these to differ
+    domain = config["domain_base"] or config["domain"]
     config["domain_ppa"] = f"ppa.{domain}"
     config["domain_ppa_private"] = f"private-ppa.{domain}"