Browse Source

feat(circleci): triggers grafana packer after successful build

Only triggers for main grafana repo (not forks) and when the
master branch is built.
Daniel Lee 10 năm trước cách đây
mục cha
commit
448437c342
2 tập tin đã thay đổi với 17 bổ sung0 xóa
  1. 7 0
      circle.yml
  2. 10 0
      trigger_grafana_packer.sh

+ 7 - 0
circle.yml

@@ -27,3 +27,10 @@ test:
      # js tests
      - ./node_modules/grunt-cli/bin/grunt test
      - npm run coveralls
+
+deployment:
+  master:
+    branch: master
+    owner: grafana
+    commands: 
+      - ./trigger_grafana_packer.sh ${TRIGGER_GRAFANA_PACKER_CIRCLECI_TOKEN}

+ 10 - 0
trigger_grafana_packer.sh

@@ -0,0 +1,10 @@
+#!/bin/bash
+
+_circle_token=$1
+
+trigger_build_url=https://circleci.com/api/v1/project/grafana/grafana-packer/tree/master?circle-token=${_circle_token}
+
+curl \
+--header "Accept: application/json" \
+--header "Content-Type: application/json" \
+--request POST ${trigger_build_url}