From 3aa84ed7312160bb7e6ca3bfe72f070830e02b07 Mon Sep 17 00:00:00 2001 From: Julian Rex Date: Thu, 19 Mar 2020 13:41:48 -0400 Subject: [PATCH] Refactor metrics triggering (#231) --- circle.yml | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/circle.yml b/circle.yml index 30f78e9d4..5adca471e 100644 --- a/circle.yml +++ b/circle.yml @@ -16,6 +16,12 @@ workflows: - ios-debug-xcode10 - ios-release-template: name: ios-release + - ios-trigger-metrics: + requires: + - ios-release + filters: + branches: + only: master - ios-release-tag: filters: tags: @@ -204,6 +210,17 @@ commands: name: Install macOS dependencies command: brew install cmake ccache pkg-config glfw3 + trigger-metrics: + steps: + - run: + name: Trigger metrics + command: | + if [ -n "${MOBILE_METRICS_TOKEN}" ]; then + bash -c "curl -X POST --header \"Content-Type: application/json\" --data '{\"parameters\": {\"run_ios_maps_benchmark\": true, \"ci_ref\": $CIRCLE_BUILD_NUM }, \"branch\": \"master\" }' https://circleci.com/api/v2/project/github/mapbox/mobile-metrics/pipeline?circle-token=${MOBILE_METRICS_TOKEN}" + else + echo "MOBILE_METRICS_TOKEN not provided" + fi + collect-xcode-build-logs: steps: - run: @@ -419,16 +436,6 @@ jobs: echo "Skipping Record size step" # Skipping due to https://github.com/mapbox/mapbox-gl-native/issues/15751 #platform/ios/scripts/metrics.sh - - run: - name: Trigger metrics - command: | - if [[ $CIRCLE_BRANCH == master ]]; then - if [ -n "${MOBILE_METRICS_TOKEN}" ]; then - curl -u ${CIRCLE_CI_TOKEN}: -X POST --header "Content-Type: application/json" --data '{"parameters": {"run_ios_maps_benchmark": true, "ci_ref" : $CIRCLE_BUILD_NUM }, "branch": "master"}' https://circleci.com/api/v2/project/github/mapbox/mobile-metrics/pipeline - else - echo "MOBILE_METRICS_TOKEN not provided" - fi - fi - save-dependencies - collect-xcode-build-logs - upload-xcode-build-logs @@ -487,6 +494,13 @@ jobs: export SLACK_COLOR="good" scripts/notify-slack.sh +# ------------------------------------------------------------------------------ + ios-trigger-metrics: + macos: + xcode: "11.2.1" + steps: + - trigger-metrics + # ------------------------------------------------------------------------------ macos-debug: macos: