Merge lp:~cjwatson/ubuntu-archive-publishing/site-name into lp:ubuntu-archive-publishing

Proposed by Colin Watson
Status: Merged
Merged at revision: 124
Proposed branch: lp:~cjwatson/ubuntu-archive-publishing/site-name
Merge into: lp:ubuntu-archive-publishing
Diff against target: 83 lines (+17/-8)
3 files modified
finalize.d/90-trigger-mirrors (+9/-0)
publish-distro.d/10-sign-releases (+4/-4)
sign.d/10-sign (+4/-4)
To merge this branch: bzr merge lp:~cjwatson/ubuntu-archive-publishing/site-name
Reviewer Review Type Date Requested Status
Steve Langasek Approve
Review via email: mp+449444@code.launchpad.net

Commit message

Conditionalize some behaviour on SITE_NAME.

Description of the change

As described in https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/449286, we need to handle telling the difference between Launchpad's production and non-production deployments in a somewhat different way in order to support charmed deployments. Update a couple of scripts to check the new SITE_NAME environment variable as well as LPCONFIG. This retains compatibility with legacy deployments (`LPCONFIG=ftpmaster-publish` etc. as opposed to `LPCONFIG=launchpad-ftpmaster-publisher` etc.) for now.

While I'm here, also arrange that we only try to trigger mirrors if we're running on the primary archive publisher for production.

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'finalize.d/90-trigger-mirrors'
2--- finalize.d/90-trigger-mirrors 2022-06-02 23:28:50 +0000
3+++ finalize.d/90-trigger-mirrors 2023-08-18 13:38:53 +0000
4@@ -2,6 +2,15 @@
5
6 # Prod the master mirrors to propagate the update.
7
8+case $SITE_NAME:$LPCONFIG in
9+ launchpad.net:ftpmaster-publish|launchpad.net:launchpad-ftpmaster-publisher)
10+ ;;
11+ *)
12+ # Only trigger mirrors when running on production.
13+ exit 0
14+ ;;
15+esac
16+
17 DISTRIBUTIONS="$(echo "$ARCHIVEROOTS" | xargs -n1 basename | xargs | tr ' ' :)"
18
19 case :$DISTRIBUTIONS: in
20
21=== modified file 'publish-distro.d/10-sign-releases'
22--- publish-distro.d/10-sign-releases 2020-06-17 10:41:44 +0000
23+++ publish-distro.d/10-sign-releases 2023-08-18 13:38:53 +0000
24@@ -30,8 +30,8 @@
25 gpg_opts () {
26 local series
27 series="$(path_to_series "$1")"
28- case $LPCONFIG in
29- ftpmaster-publish)
30+ case $SITE_NAME:$LPCONFIG in
31+ launchpad.net:ftpmaster-publish|launchpad.net:launchpad-ftpmaster-publisher)
32 case "$series:$1" in
33 # Use single-signature 1024 key SHA1 for old releases
34 warty:*|hoary:*|breezy:*|dapper:*|edgy:*|feisty:*|gutsy:*|hardy:*|intrepid:*|jaunty:*|karmic:*|lucid:*|maverick:*|natty:*|oneiric:*|precise:*)
35@@ -63,14 +63,14 @@
36 ;;
37 esac
38 ;;
39- derived-distro-publish)
40+ launchpad.net:derived-distro-publish|launchpad.net:launchpad-copy-archive-publisher)
41 case $ARCHIVEROOT in
42 */ubuntu-rtm)
43 printf '%s\n' "-u 5810338B"
44 ;;
45 esac
46 ;;
47- dogfood-publish)
48+ dogfood.paddev.net:dogfood-publish|dogfood.paddev.net:launchpad-copy-archive-publisher)
49 local distribution
50 distribution="$(basename "$ARCHIVEROOT")"
51 case "$distribution" in
52
53=== modified file 'sign.d/10-sign'
54--- sign.d/10-sign 2020-06-17 10:41:44 +0000
55+++ sign.d/10-sign 2023-08-18 13:38:53 +0000
56@@ -17,8 +17,8 @@
57 gpg_opts () {
58 local series
59 series="${SUITE%%-*}"
60- case $LPCONFIG in
61- ftpmaster-publish)
62+ case $SITE_NAME:$LPCONFIG in
63+ launchpad.net:ftpmaster-publish|launchpad.net:launchpad-ftpmaster-publisher)
64 case "$series:$1" in
65 # Use single-signature 1024 key SHA1 for old releases
66 warty:*|hoary:*|breezy:*|dapper:*|edgy:*|feisty:*|gutsy:*|hardy:*|intrepid:*|jaunty:*|karmic:*|lucid:*|maverick:*|natty:*|oneiric:*|precise:*)
67@@ -50,14 +50,14 @@
68 ;;
69 esac
70 ;;
71- derived-distro-publish)
72+ launchpad.net:derived-distro-publish|launchpad.net:launchpad-copy-archive-publisher)
73 case $DISTRIBUTION in
74 ubuntu-rtm)
75 printf '%s\n' "-u 5810338B"
76 ;;
77 esac
78 ;;
79- dogfood-publish)
80+ dogfood.paddev.net:dogfood-publish|dogfood.paddev.net:launchpad-copy-archive-publisher)
81 case $DISTRIBUTION in
82 ubuntu-rtm)
83 printf '%s\n' "-u 272AD8D5"

Subscribers

People subscribed via source and target branches