Assorted cleanups for new package infrastructure upload support. (#13270)
* Ignore failures to upload packages to new infra. We will switch to requiring success when we move to the new infra as the primary. * Change package upload target. Needed to properly support handling of package repository metadata. * Upload repoconfig packages to new infra.
Austin S. Hemmelgarn committed
Jun 30, 2022 at 14:10 UTC
b2e3d3e99f8679440864e9f99a1e0a843cfae126
3 files changed
+50
-17
.github/scripts/package-upload.sh
+1
-1
@@ -11,7 +11,7 @@ format="${3}"
11
repo="${4}"
12
13
staging="${TMPDIR:-/tmp}/package-staging"
14
-prefix="/var/www/html/repos/${repo}/"
14
+prefix="/home/netdatabot/incoming/${repo}/"
15
16
packages="$(find artifacts -name "*.${format}")"
17
.github/workflows/packaging.yml
+17
-15
@@ -214,22 +214,10 @@ jobs:
214
-e VERSION=${{ needs.version-check.outputs.version }} -e DISTRO_VERSION=${{ matrix.version }} \
215
--platform=${{ matrix.platform }} -v "$PWD":/netdata ${{ matrix.base_image }}:${{ matrix.version }} \
216
/netdata/.github/scripts/pkg-test.sh
217
- - name: Upload to PackageCloud
218
- id: upload
219
- if: github.event_name == 'workflow_dispatch'
220
- shell: bash
221
- env:
222
- PKG_CLOUD_TOKEN: ${{ secrets.PACKAGE_CLOUD_API_KEY }}
223
- run: |
224
- printf "Packages to upload:\n%s" "$(ls artifacts/*.${{ matrix.format }})"
225
- for pkgfile in artifacts/*.${{ matrix.format }} ; do
226
- .github/scripts/package_cloud_wrapper.sh yank ${{ needs.version-check.outputs.repo }}/${{ matrix.repo_distro }} \
227
- "$(basename "${pkgfile}")" || true
228
- .github/scripts/package_cloud_wrapper.sh push ${{ needs.version-check.outputs.repo }}/${{ matrix.repo_distro }} "${pkgfile}"
229
- done
217
- name: SSH setup
218
id: ssh-setup
219
if: github.event_name == 'workflow_dispatch'
220
+ continue-on-error: true
221
uses: shimataro/ssh-key-action@v2
222
with:
223
key: ${{ secrets.NETDATABOT_PACKAGES_SSH_KEY }}
@@ -237,6 +225,7 @@ jobs:
225
known_hosts: ${{ secrets.PACKAGES_KNOWN_HOSTS }}
226
- name: Upload to packages.netdata.cloud
227
id: package-upload
228
+ continue-on-error: true
229
if: github.event_name == 'workflow_dispatch'
230
run: |
231
.github/scripts/package-upload.sh \
@@ -244,6 +233,19 @@ jobs:
233
${{ matrix.arch }} \
234
${{ matrix.format }} \
235
${{ needs.version-check.outputs.repo }}
236
+ - name: Upload to PackageCloud
237
+ id: upload
238
+ if: github.event_name == 'workflow_dispatch'
239
+ shell: bash
240
+ env:
241
+ PKG_CLOUD_TOKEN: ${{ secrets.PACKAGE_CLOUD_API_KEY }}
242
+ run: |
243
+ printf "Packages to upload:\n%s" "$(ls artifacts/*.${{ matrix.format }})"
244
+ for pkgfile in artifacts/*.${{ matrix.format }} ; do
245
+ .github/scripts/package_cloud_wrapper.sh yank ${{ needs.version-check.outputs.repo }}/${{ matrix.repo_distro }} \
246
+ "$(basename "${pkgfile}")" || true
247
+ .github/scripts/package_cloud_wrapper.sh push ${{ needs.version-check.outputs.repo }}/${{ matrix.repo_distro }} "${pkgfile}"
248
+ done
249
- name: Failure Notification
250
uses: rtCamp/action-slack-notify@v2
251
env:
@@ -259,9 +261,9 @@ jobs:
261
Fetch images: ${{ steps.fetch-images.outcome }}
262
Build: ${{ steps.build.outcome }}
263
Test: ${{ steps.test.outcome }}
262
- Publish: ${{ steps.upload.outcome }}
264
Import SSH Key: ${{ steps.ssh-setup.outcome }}
264
- Publish: ${{ steps.package-upload.outcome }}
265
+ Publish to packages.netdata.cloud: ${{ steps.package-upload.outcome }}
266
+ Publish to PackageCloud: ${{ steps.upload.outcome }}
267
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
268
if: >-
269
${{
.github/workflows/repoconfig-packages.yml
+32
-1
@@ -112,6 +112,35 @@ jobs:
112
docker run --security-opt seccomp=unconfined -e DISABLE_TELEMETRY=1 --platform ${{ matrix.platform }} \
113
-v "$PWD":/netdata ${{ matrix.base_image }}:${{ matrix.version }} \
114
/netdata/packaging/repoconfig/build-${{ matrix.format }}.sh
115
+ - name: SSH setup
116
+ id: ssh-setup
117
+ if: github.event_name == 'workflow_dispatch'
118
+ continue-on-error: true
119
+ uses: shimataro/ssh-key-action@v2
120
+ with:
121
+ key: ${{ secrets.NETDATABOT_PACKAGES_SSH_KEY }}
122
+ name: id_ecdsa
123
+ known_hosts: ${{ secrets.PACKAGES_KNOWN_HOSTS }}
124
+ - name: Upload to packages.netdata.cloud
125
+ id: package-upload
126
+ continue-on-error: true
127
+ if: github.event_name == 'workflow_dispatch'
128
+ run: |
129
+ .github/scripts/package-upload.sh \
130
+ ${{ matrix.repo_distro }} \
131
+ ${{ matrix.arch }} \
132
+ ${{ matrix.format }} \
133
+ netdata/netdata
134
+ .github/scripts/package-upload.sh \
135
+ ${{ matrix.repo_distro }} \
136
+ ${{ matrix.arch }} \
137
+ ${{ matrix.format }} \
138
+ netdata/netdata-edge
139
+ .github/scripts/package-upload.sh \
140
+ ${{ matrix.repo_distro }} \
141
+ ${{ matrix.arch }} \
142
+ ${{ matrix.format }} \
143
+ netdata/netdata-repoconfig
144
- name: Upload Packages
145
id: publish
146
if: github.event_name != 'pull_request' && github.repository == 'netdata/netdata'
@@ -145,5 +174,7 @@ jobs:
174
Checkout: ${{ steps.checkout.outcome }}
175
Fetch images: ${{ steps.fetch-images.outcome }}
176
Build: ${{ steps.build.outcome }}
148
- Publish: ${{ steps.publish.outcome }}
177
+ Import SSH Key: ${{ steps.ssh-setup.outcome }}
178
+ Publish to packages.netdata.cloud: ${{ steps.package-upload.outcome }}
179
+ Publish to PackageCloud: ${{ steps.publish.outcome }}
180
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}