summaryrefslogtreecommitdiffstats
path: root/.travis/trigger_docker_build.sh
diff options
context:
space:
mode:
Diffstat (limited to '.travis/trigger_docker_build.sh')
-rwxr-xr-x.travis/trigger_docker_build.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/.travis/trigger_docker_build.sh b/.travis/trigger_docker_build.sh
new file mode 100755
index 00000000..7a3dd508
--- /dev/null
+++ b/.travis/trigger_docker_build.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+token="${1}"
+version="${2}"
+
+resp="$(curl -X POST \
+ -H 'Accept: application/vnd.github.v3+json' \
+ -H "Authorization: Bearer ${token}" \
+ "https://api.github.com/repos/netdata/netdata/actions/workflows/docker.yml/dispatches" \
+ -d "{\"ref\": \"master\", \"inputs\": {\"version\": \"${version}\"}}")"
+
+if [ -z "${resp}" ]; then
+ echo "Successfully triggered Docker image build."
+ exit 0
+else
+ echo "Failed to trigger Docker image build. Output:"
+ echo "${resp}"
+ exit 1
+fi