summaryrefslogtreecommitdiffstats
path: root/.github/workflows
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-08-10 09:18:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-08-10 09:19:08 +0000
commita2d7dede737947d7c6afa20a88e1f0c64e0eb96c (patch)
treefed4aff7dbe0be00cf91de6261d98bc0eb9a2449 /.github/workflows
parentReleasing debian version 1.41.0-1. (diff)
downloadnetdata-a2d7dede737947d7c6afa20a88e1f0c64e0eb96c.tar.xz
netdata-a2d7dede737947d7c6afa20a88e1f0c64e0eb96c.zip
Merging upstream version 1.42.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build.yml5
-rw-r--r--.github/workflows/generate-integrations.yml98
-rw-r--r--.github/workflows/review.yml2
3 files changed, 102 insertions, 3 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 114eb2c53..012f75ac5 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -519,6 +519,7 @@ jobs:
mv ../static-archive/* . || exit 1
ln -s ${{ needs.build-dist.outputs.distfile }} netdata-latest.tar.gz || exit 1
cp ../packaging/version ./latest-version.txt || exit 1
+ cp ../integrations/integrations.js ./integrations.js || exit 1
sha256sum -b ./* > sha256sums.txt || exit 1
cat sha256sums.txt
- name: Store Artifacts
@@ -753,7 +754,7 @@ jobs:
with:
allowUpdates: false
artifactErrorsFailBuild: true
- artifacts: 'final-artifacts/sha256sums.txt,final-artifacts/netdata-*.tar.gz,final-artifacts/netdata-*.gz.run'
+ artifacts: 'final-artifacts/sha256sums.txt,final-artifacts/netdata-*.tar.gz,final-artifacts/netdata-*.gz.run,final-artifacts/integrations.js'
owner: netdata
repo: netdata-nightlies
body: Netdata nightly build for ${{ steps.version.outputs.date }}.
@@ -823,7 +824,7 @@ jobs:
with:
allowUpdates: false
artifactErrorsFailBuild: true
- artifacts: 'final-artifacts/sha256sums.txt,final-artifacts/netdata-*.tar.gz,final-artifacts/netdata-*.gz.run'
+ artifacts: 'final-artifacts/sha256sums.txt,final-artifacts/netdata-*.tar.gz,final-artifacts/netdata-*.gz.run,final-artifacts/integrations.js'
draft: true
tag: ${{ needs.normalize-tag.outputs.tag }}
token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
diff --git a/.github/workflows/generate-integrations.yml b/.github/workflows/generate-integrations.yml
new file mode 100644
index 000000000..599cefbc0
--- /dev/null
+++ b/.github/workflows/generate-integrations.yml
@@ -0,0 +1,98 @@
+---
+# CI workflow used to regenerate `integrations/integrations.js` when
+# relevant source files are changed.
+name: Generate Integrations
+on:
+ push:
+ branches:
+ - master
+ paths: # If any of these files change, we need to regenerate integrations.js.
+ - 'collectors/**/metadata.yaml'
+ - 'exporting/**/metadata.yaml'
+ - 'health/notifications/**/metadata.yaml'
+ - 'integrations/templates/**'
+ - 'integrations/categories.yaml'
+ - 'integrations/deploy.yaml'
+ - 'integrations/cloud-notifications/metadata.yaml'
+ - 'integrations/gen_integrations.py'
+ - 'packaging/go.d.version'
+ workflow_dispatch: null
+concurrency: # This keeps multiple instances of the job from running concurrently for the same ref.
+ group: integrations-${{ github.ref }}
+ cancel-in-progress: true
+jobs:
+ generate-integrations:
+ name: Generate Integrations
+ runs-on: ubuntu-latest
+ if: github.repository == 'netdata/netdata'
+ steps:
+ - name: Checkout Agent
+ id: checkout-agent
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 1
+ submodules: recursive
+ - name: Get Go Ref
+ id: get-go-ref
+ run: echo "go_ref=$(cat packaging/go.d.version)" >> "${GITHUB_ENV}"
+ - name: Checkout Go
+ id: checkout-go
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 1
+ path: go.d.plugin
+ repository: netdata/go.d.plugin
+ ref: ${{ env.go_ref }}
+ - name: Prepare Dependencies
+ id: prep-deps
+ run: |
+ sudo apt-get install python3-venv
+ python3 -m venv ./virtualenv
+ source ./virtualenv/bin/activate
+ pip install jsonschema referencing jinja2 ruamel.yaml
+ - name: Generate Integrations
+ id: generate
+ run: |
+ source ./virtualenv/bin/activate
+ python3 integrations/gen_integrations.py
+ - name: Clean Up Temporary Data
+ id: clean
+ run: rm -rf go.d.plugin virtualenv
+ - name: Create PR
+ id: create-pr
+ uses: peter-evans/create-pull-request@v5
+ with:
+ token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
+ commit-message: Regenerate integrations.js
+ branch: integrations-regen
+ title: Regenerate integrations.js
+ body: |
+ Regenerate `integrations/integrations.js` based on the
+ latest code.
+
+ This PR was auto-generated by
+ `.github/workflows/generate-integrations.yml`.
+ - name: Failure Notification
+ uses: rtCamp/action-slack-notify@v2
+ env:
+ SLACK_COLOR: 'danger'
+ SLACK_FOOTER: ''
+ SLACK_ICON_EMOJI: ':github-actions:'
+ SLACK_TITLE: 'Integrations regeneration failed:'
+ SLACK_USERNAME: 'GitHub Actions'
+ SLACK_MESSAGE: |-
+ ${{ github.repository }}: Failed to create PR rebuilding integrations.js
+ Checkout Agent: ${{ steps.checkout-agent.outcome }}
+ Get Go Ref: ${{ steps.get-go-ref.outcome }}
+ Checkout Go: ${{ steps.checkout-go.outcome }}
+ Prepare Dependencies: ${{ steps.prep-deps.outcome }}
+ Generate Integrations: ${{ steps.generate.outcome }}
+ Clean Up Temporary Data: ${{ steps.clean.outcome }}
+ Create PR: ${{ steps.create-pr.outcome }}
+ SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
+ if: >-
+ ${{
+ failure()
+ && startsWith(github.ref, 'refs/heads/master')
+ && github.repository == 'netdata/netdata'
+ }}
diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml
index 6a580afa6..7e76717ed 100644
--- a/.github/workflows/review.yml
+++ b/.github/workflows/review.yml
@@ -54,7 +54,7 @@ jobs:
run: |
if [ "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/eslint') }}" = "true" ]; then
echo "run=true" >> "${GITHUB_OUTPUT}"
- elif git diff --name-only origin/${{ github.base_ref }} HEAD | grep -v "web/gui/v1" | grep -v "web/gui/v2" | grep -Eq '.*\.js|node\.d\.plugin\.in' ; then
+ elif git diff --name-only origin/${{ github.base_ref }} HEAD | grep -v "web/gui/v1" | grep -v "web/gui/v2" | grep -v "integrations/" | grep -Eq '.*\.js' ; then
echo "run=true" >> "${GITHUB_OUTPUT}"
echo 'JS files have changed, need to run ESLint.'
else