aboutsummaryrefslogtreecommitdiff
path: root/scripts/trigger_release_build.sh
diff options
context:
space:
mode:
authorMenny Even Danan <menny@evendanan.net>2017-07-16 00:23:50 +0000
committerMenny Even Danan <menny@evendanan.net>2017-07-16 00:24:45 +0000
commit0a7b03bc63098f9ca5299db4fc45f22055e83f72 (patch)
tree1b02505aa50d0ca9ed7111236e71eb79a54f3abb /scripts/trigger_release_build.sh
parent5bb5229d703a52f4e35f4c3807838ce0cba5e0d8 (diff)
downloadAnySoftKeyboard-0a7b03bc63098f9ca5299db4fc45f22055e83f72.tar.gz
AnySoftKeyboard-0a7b03bc63098f9ca5299db4fc45f22055e83f72.tar.bz2
Allow release from API call
Diffstat (limited to 'scripts/trigger_release_build.sh')
-rwxr-xr-xscripts/trigger_release_build.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/trigger_release_build.sh b/scripts/trigger_release_build.sh
new file mode 100755
index 000000000..0b45a0f67
--- /dev/null
+++ b/scripts/trigger_release_build.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+if [ -z "${CIRCLE_CI_API}" ]; then
+ echo "Could not find CIRCLE_CI_API environment variable"
+ exit 1
+fi
+
+curl "https://circleci.com/api/v1.1/project/github/AnySoftKeyboard/AnySoftKeyboard?circle-token=${CIRCLE_CI_API}" -o /tmp/recentbuilds.txt
+echo "Recent builds:"
+head -n 60 /tmp/recentbuilds.txt
+
+read -p "Continue with triggerring release build? " -n 1 -r
+echo # (optional) move to a new line
+if [[ $REPLY =~ ^[Yy]$ ]]
+then
+ echo "!!!!!!!!!!!!!!RELEASING!!!!!!!!!!"
+ curl \
+ -o /tmp/buildtrigger.txt
+ --header "Content-Type: application/json" \
+ --data '{"build_parameters": {"ASK_RELEASE_VARIANT": "TRUE"}}' \
+ --request POST \
+ "https://circleci.com/api/v1.1/project/github/AnySoftKeyboard/AnySoftKeyboard/tree/master?circle-token=$CIRCLE_CI_API"
+ echo "**Result:"
+ cat /tmp/buildtrigger.txt
+ echo "**End of result."
+else
+ echo "Okay, no release."
+fi \ No newline at end of file