From 8bbc4a217831be34ffa72993956fd5b46efd0a75 Mon Sep 17 00:00:00 2001 From: Dan Swick Date: Wed, 18 Sep 2019 12:44:18 -0700 Subject: [android, build] Generalize docs deployment script and add Android docs deployment to circle config (#15299) --- circle.yml | 11 ++++++- .../ios/scripts/trigger-external-deploy-steps.sh | 34 -------------------- scripts/trigger-maps-documentation-deploy-steps.sh | 36 ++++++++++++++++++++++ 3 files changed, 46 insertions(+), 35 deletions(-) delete mode 100755 platform/ios/scripts/trigger-external-deploy-steps.sh create mode 100755 scripts/trigger-maps-documentation-deploy-steps.sh diff --git a/circle.yml b/circle.yml index fb3956f256..2d1e7e3f73 100644 --- a/circle.yml +++ b/circle.yml @@ -1008,6 +1008,14 @@ jobs: make run-android-upload-to-artifactory fi fi + - run: + name: Trigger external deploy steps + command: | + export VERSION_TAG=${CIRCLE_TAG} + export GITHUB_TOKEN=${DANGER_GITHUB_API_TOKEN} + export DOCS_REPO="android-docs" + scripts/trigger-maps-documentation-deploy-steps.sh + background: true - run: name: Record size command: platform/android/scripts/metrics.sh @@ -1447,7 +1455,8 @@ jobs: command: | export VERSION_TAG=${CIRCLE_TAG} export GITHUB_TOKEN=${DANGER_GITHUB_API_TOKEN} - platform/ios/scripts/trigger-external-deploy-steps.sh + export DOCS_REPO="ios-sdk" + scripts/trigger-maps-documentation-deploy-steps.sh - run: name: Build, package, and upload iOS release command: | diff --git a/platform/ios/scripts/trigger-external-deploy-steps.sh b/platform/ios/scripts/trigger-external-deploy-steps.sh deleted file mode 100755 index c1ee7c783f..0000000000 --- a/platform/ios/scripts/trigger-external-deploy-steps.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; } -function finish { >&2 echo -en "\033[0m"; } -trap finish EXIT - -SDK_FLAVOR=${SDK_FLAVOR:-"maps"} - -step "Triggering automated site and documentation generation for ${SDK_FLAVOR} SDK ${VERSION_TAG}" - -request_body="{ - \"request\": { - \"message\": \"[${SDK_FLAVOR}] ${VERSION_TAG} automated site and documentation generation\", - \"config\": { - \"merge_mode\": \"deep_merge\", - \"env\": { - \"SDK_FLAVOR\": \"${SDK_FLAVOR}\", - \"RELEASE_TAG\": \"${VERSION_TAG}\" - } - } - } -}" - -step "Making request…" - -curl -s -X POST \ - -H "Content-Type: application/json" \ - -H "Accept: application/json" \ - -H "Travis-API-Version: 3" \ - -H "Authorization: token ${TRAVISCI_API_TOKEN}" \ - -d "${request_body}" \ - https://api.travis-ci.com/repo/mapbox%2Fios-sdk/requests diff --git a/scripts/trigger-maps-documentation-deploy-steps.sh b/scripts/trigger-maps-documentation-deploy-steps.sh new file mode 100755 index 0000000000..128b7cda8b --- /dev/null +++ b/scripts/trigger-maps-documentation-deploy-steps.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +set -euo pipefail + +function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; } +function finish { >&2 echo -en "\033[0m"; } +trap finish EXIT + +SDK_FLAVOR=${SDK_FLAVOR:-"maps"} + +step "Triggering automated site and documentation generation for ${SDK_FLAVOR} SDK ${VERSION_TAG}" + +# No branch specified, so default branch will be used +request_body="{ + \"request\": { + \"message\": \"[${SDK_FLAVOR}] ${VERSION_TAG} automated site and documentation generation\", + \"config\": { + \"merge_mode\": \"deep_merge\", + \"env\": { + \"SDK_FLAVOR\": \"${SDK_FLAVOR}\", + \"RELEASE_TAG\": \"${VERSION_TAG}\" + } + } + } +}" + +step "Making request…" + +# Request URL set to docs-sandbox while testing +curl -s -X POST \ + -H "Content-Type: application/json" \ + -H "Accept: application/json" \ + -H "Travis-API-Version: 3" \ + -H "Authorization: token ${TRAVISCI_API_TOKEN}" \ + -d "${request_body}" \ + https://api.travis-ci.com/repo/mapbox%2F${DOCS_REPO}/requests -- cgit v1.2.1