Update CI infrastructure to publish to secondary packaging host. (#17863)
* Update CI infrastructure to publish to secondary packaging host. * Fix typo.
Austin S. Hemmelgarn committed
Jun 12, 2024 at 10:45 UTC
71994bf681c7bb2864a8a398cbe9b8021b29fd4f
6 files changed
+53
-11
.github/scripts/package-upload.sh
+5
-5
@@ -2,13 +2,13 @@
2
3
set -e
4
5
-host="packages.netdata.cloud"
5
user="netdatabot"
6
8
-distro="${1}"
9
-arch="${2}"
10
-format="${3}"
11
-repo="${4}"
7
+host="${1}"
8
+distro="${2}"
9
+arch="${3}"
10
+format="${4}"
11
+repo="${5}"
12
13
staging="${TMPDIR:-/tmp}/package-staging"
14
prefix="/home/netdatabot/incoming/${repo}/"
.github/scripts/upload-new-version-tags.sh
+2
-1
@@ -2,9 +2,10 @@
2
3
set -e
4
5
-host="packages.netdata.cloud"
5
user="netdatabot"
6
7
+host="${1}"
8
+
9
prefix="/var/www/html/releases"
10
staging="${TMPDIR:-/tmp}/staging-new-releases"
11
.github/workflows/kickstart-upload.yml
+8
-3
@@ -30,9 +30,13 @@ jobs:
30
key: ${{ secrets.NETDATABOT_PACKAGES_SSH_KEY }}
31
name: id_ecdsa
32
known_hosts: ${{ secrets.PACKAGES_KNOWN_HOSTS }}
33
- - name: Upload
34
- id: upload
33
+ - name: Upload to packages.netdata.cloud
34
+ id: upload-primary
35
+ continue-on-error: true
36
run: rsync -vp packaging/installer/kickstart.sh netdatabot@packages.netdata.cloud:/home/netdatabot/incoming/kickstart.sh
37
+ - name: Upload to packages2.netdata.cloud
38
+ id: upload-packages2
39
+ run: rsync -vp packaging/installer/kickstart.sh netdatabot@packages2.netdata.cloud:/home/netdatabot/incoming/kickstart.sh
40
- name: Failure Notification
41
uses: rtCamp/action-slack-notify@v2
42
env:
@@ -44,7 +48,8 @@ jobs:
48
${{ github.repository }}: Failed to upload updated kickstart script to repo server.
49
Checkout: ${{ steps.checkout.outcome }}
50
Import SSH Key: ${{ steps.ssh-setup.outcome }}
47
- Upload: ${{ steps.upload.outcome }}
51
+ Upload to packages.netdata.cloud: ${{ steps.upload-packages.outcome }}
52
+ Upload to packages2.netdata.cloud: ${{ steps.upload-packages2.outcome }}
53
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
54
if: >-
55
${{
.github/workflows/monitor-releases.yml
+9
-2
@@ -55,11 +55,17 @@ jobs:
55
key: ${{ secrets.NETDATABOT_PACKAGES_SSH_KEY }}
56
name: id_ecdsa
57
known_hosts: ${{ secrets.PACKAGES_KNOWN_HOSTS }}
58
- - name: Sync newer releases
58
+ - name: Sync newer releases to packages.netdata.cloud
59
id: sync-releases
60
+ continue-on-error: true
61
if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && steps.check-newer-releases.outputs.versions_needs_update == 'true'
62
run: |
62
- .github/scripts/upload-new-version-tags.sh
63
+ .github/scripts/upload-new-version-tags.sh packages.netdata.cloud
64
+ - name: Sync newer releases to packages2.netdata.cloud
65
+ id: sync-releases2
66
+ if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && steps.check-newer-releases.outputs.versions_needs_update == 'true'
67
+ run: |
68
+ .github/scripts/upload-new-version-tags.sh packages2.netdata.cloud
69
- name: Failure Notification
70
uses: rtCamp/action-slack-notify@v2
71
env:
@@ -77,5 +83,6 @@ jobs:
83
Check for newer stable releaes: ${{ steps.check-newer-releases.outcome }}
84
Setup ssh: ${{ steps.ssh-setup.outcome }}
85
Syncing newer release to packages.netdata.cloud : ${{ steps.sync-releases.outcome }}
86
+ Syncing newer release to packages2.netdata.cloud : ${{ steps.sync-releases2.outcome }}
87
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
88
if: failure()
.github/workflows/packaging.yml
+13
@@ -300,9 +300,21 @@ jobs:
300
known_hosts: ${{ secrets.PACKAGES_KNOWN_HOSTS }}
301
- name: Upload to packages.netdata.cloud
302
id: package-upload
303
+ continue-on-error: true
304
+ if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && needs.file-check.outputs.run == 'true'
305
+ run: |
306
+ .github/scripts/package-upload.sh \
307
+ packages.netdata.cloud \
308
+ ${{ matrix.repo_distro }} \
309
+ ${{ matrix.arch }} \
310
+ ${{ matrix.format }} \
311
+ ${{ needs.version-check.outputs.repo }}
312
+ - name: Upload to packages2.netdata.cloud
313
+ id: package2-upload
314
if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && needs.file-check.outputs.run == 'true'
315
run: |
316
.github/scripts/package-upload.sh \
317
+ packages2.netdata.cloud \
318
${{ matrix.repo_distro }} \
319
${{ matrix.arch }} \
320
${{ matrix.format }} \
@@ -325,6 +337,7 @@ jobs:
337
Publish to PackageCloud: ${{ steps.upload.outcome }}
338
Import SSH Key: ${{ steps.ssh-setup.outcome }}
339
Publish to packages.netdata.cloud: ${{ steps.package-upload.outcome }}
340
+ Publish to packages2.netdata.cloud: ${{ steps.package2-upload.outcome }}
341
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
342
if: >-
343
${{
.github/workflows/repoconfig-packages.yml
+16
@@ -118,12 +118,27 @@ jobs:
118
name: id_ecdsa
119
known_hosts: ${{ secrets.PACKAGES_KNOWN_HOSTS }}
120
- name: Upload to packages.netdata.cloud
121
+ id: package-upload
122
+ continue-on-error: true
123
+ if: github.event_name != 'pull_request' && github.repository == 'netdata/netdata'
124
+ run: |
125
+ # shellcheck disable=SC2043
126
+ for arch in ${{ matrix.arches }}; do
127
+ .github/scripts/package-upload.sh \
128
+ packages.netdata.cloud \
129
+ "${{ matrix.pkgclouddistro }}" \
130
+ "${arch}" \
131
+ "${{ matrix.format }}" \
132
+ netdata/netdata-repoconfig
133
+ done
134
+ - name: Upload to packages2.netdata.cloud
135
id: package-upload
136
if: github.event_name != 'pull_request' && github.repository == 'netdata/netdata'
137
run: |
138
# shellcheck disable=SC2043
139
for arch in ${{ matrix.arches }}; do
140
.github/scripts/package-upload.sh \
141
+ packages2.netdata.cloud \
142
"${{ matrix.pkgclouddistro }}" \
143
"${arch}" \
144
"${{ matrix.format }}" \
@@ -146,4 +161,5 @@ jobs:
161
Publish to PackageCloud: ${{ steps.publish.outcome }}
162
Import SSH Key: ${{ steps.ssh-setup.outcome }}
163
Publish to packages.netdata.cloud: ${{ steps.package-upload.outcome }}
164
+ Publish to packages2.netdata.cloud: ${{ steps.package2-upload.outcome }}
165
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}