Skip to content

Commit

Permalink
Update CI infrastructure to publish to secondary packaging host. (net…
Browse files Browse the repository at this point in the history
…data#17863)

* Update CI infrastructure to publish to secondary packaging host.

* Fix typo.
  • Loading branch information
Ferroin authored Jun 12, 2024
1 parent 405a163 commit 71994bf
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 11 deletions.
10 changes: 5 additions & 5 deletions .github/scripts/package-upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

set -e

host="packages.netdata.cloud"
user="netdatabot"

distro="${1}"
arch="${2}"
format="${3}"
repo="${4}"
host="${1}"
distro="${2}"
arch="${3}"
format="${4}"
repo="${5}"

staging="${TMPDIR:-/tmp}/package-staging"
prefix="/home/netdatabot/incoming/${repo}/"
Expand Down
3 changes: 2 additions & 1 deletion .github/scripts/upload-new-version-tags.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

set -e

host="packages.netdata.cloud"
user="netdatabot"

host="${1}"

prefix="/var/www/html/releases"
staging="${TMPDIR:-/tmp}/staging-new-releases"

Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/kickstart-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ jobs:
key: ${{ secrets.NETDATABOT_PACKAGES_SSH_KEY }}
name: id_ecdsa
known_hosts: ${{ secrets.PACKAGES_KNOWN_HOSTS }}
- name: Upload
id: upload
- name: Upload to packages.netdata.cloud
id: upload-primary
continue-on-error: true
run: rsync -vp packaging/installer/kickstart.sh [email protected]:/home/netdatabot/incoming/kickstart.sh
- name: Upload to packages2.netdata.cloud
id: upload-packages2
run: rsync -vp packaging/installer/kickstart.sh [email protected]:/home/netdatabot/incoming/kickstart.sh
- name: Failure Notification
uses: rtCamp/action-slack-notify@v2
env:
Expand All @@ -44,7 +48,8 @@ jobs:
${{ github.repository }}: Failed to upload updated kickstart script to repo server.
Checkout: ${{ steps.checkout.outcome }}
Import SSH Key: ${{ steps.ssh-setup.outcome }}
Upload: ${{ steps.upload.outcome }}
Upload to packages.netdata.cloud: ${{ steps.upload-packages.outcome }}
Upload to packages2.netdata.cloud: ${{ steps.upload-packages2.outcome }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
if: >-
${{
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/monitor-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,17 @@ jobs:
key: ${{ secrets.NETDATABOT_PACKAGES_SSH_KEY }}
name: id_ecdsa
known_hosts: ${{ secrets.PACKAGES_KNOWN_HOSTS }}
- name: Sync newer releases
- name: Sync newer releases to packages.netdata.cloud
id: sync-releases
continue-on-error: true
if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && steps.check-newer-releases.outputs.versions_needs_update == 'true'
run: |
.github/scripts/upload-new-version-tags.sh
.github/scripts/upload-new-version-tags.sh packages.netdata.cloud
- name: Sync newer releases to packages2.netdata.cloud
id: sync-releases2
if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && steps.check-newer-releases.outputs.versions_needs_update == 'true'
run: |
.github/scripts/upload-new-version-tags.sh packages2.netdata.cloud
- name: Failure Notification
uses: rtCamp/action-slack-notify@v2
env:
Expand All @@ -77,5 +83,6 @@ jobs:
Check for newer stable releaes: ${{ steps.check-newer-releases.outcome }}
Setup ssh: ${{ steps.ssh-setup.outcome }}
Syncing newer release to packages.netdata.cloud : ${{ steps.sync-releases.outcome }}
Syncing newer release to packages2.netdata.cloud : ${{ steps.sync-releases2.outcome }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
if: failure()
13 changes: 13 additions & 0 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,21 @@ jobs:
known_hosts: ${{ secrets.PACKAGES_KNOWN_HOSTS }}
- name: Upload to packages.netdata.cloud
id: package-upload
continue-on-error: true
if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && needs.file-check.outputs.run == 'true'
run: |
.github/scripts/package-upload.sh \
packages.netdata.cloud \
${{ matrix.repo_distro }} \
${{ matrix.arch }} \
${{ matrix.format }} \
${{ needs.version-check.outputs.repo }}
- name: Upload to packages2.netdata.cloud
id: package2-upload
if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && needs.file-check.outputs.run == 'true'
run: |
.github/scripts/package-upload.sh \
packages2.netdata.cloud \
${{ matrix.repo_distro }} \
${{ matrix.arch }} \
${{ matrix.format }} \
Expand All @@ -325,6 +337,7 @@ jobs:
Publish to PackageCloud: ${{ steps.upload.outcome }}
Import SSH Key: ${{ steps.ssh-setup.outcome }}
Publish to packages.netdata.cloud: ${{ steps.package-upload.outcome }}
Publish to packages2.netdata.cloud: ${{ steps.package2-upload.outcome }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
if: >-
${{
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/repoconfig-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,27 @@ jobs:
name: id_ecdsa
known_hosts: ${{ secrets.PACKAGES_KNOWN_HOSTS }}
- name: Upload to packages.netdata.cloud
id: package-upload
continue-on-error: true
if: github.event_name != 'pull_request' && github.repository == 'netdata/netdata'
run: |
# shellcheck disable=SC2043
for arch in ${{ matrix.arches }}; do
.github/scripts/package-upload.sh \
packages.netdata.cloud \
"${{ matrix.pkgclouddistro }}" \
"${arch}" \
"${{ matrix.format }}" \
netdata/netdata-repoconfig
done
- name: Upload to packages2.netdata.cloud
id: package-upload
if: github.event_name != 'pull_request' && github.repository == 'netdata/netdata'
run: |
# shellcheck disable=SC2043
for arch in ${{ matrix.arches }}; do
.github/scripts/package-upload.sh \
packages2.netdata.cloud \
"${{ matrix.pkgclouddistro }}" \
"${arch}" \
"${{ matrix.format }}" \
Expand All @@ -146,4 +161,5 @@ jobs:
Publish to PackageCloud: ${{ steps.publish.outcome }}
Import SSH Key: ${{ steps.ssh-setup.outcome }}
Publish to packages.netdata.cloud: ${{ steps.package-upload.outcome }}
Publish to packages2.netdata.cloud: ${{ steps.package2-upload.outcome }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}

0 comments on commit 71994bf

Please sign in to comment.