Created
February 14, 2019 14:30
-
-
Save valllllll2000/a4aecfb76f2edf8153514a41a9a1cdd7 to your computer and use it in GitHub Desktop.
trigger travis to deploy app to instance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -o nounset | |
# usage: sh travis_flow_app_build.sh instace branch token | |
# example sh travis_flow_app_build.sh akvoflow-uat1 release/2.7.1 xxx | |
# get your token from Travis website, in your user settings | |
# for a deploy in production use the master branch | |
instance=$1 | |
branch=$2 | |
token=$3 | |
body='{ | |
"request": { | |
"message": "deploy to '$instance'", | |
"branch": "'$branch'", | |
"config": { | |
"script": "./travis/deploy_release.sh '$instance'", | |
"before_script": "echo skipped", | |
"after_success": "echo skipped" | |
} | |
}}' | |
curl -s -X POST \ | |
-H "Content-Type: application/json" \ | |
-H "Accept: application/json" \ | |
-H "Travis-API-Version: 3" \ | |
-H "Authorization: token "$token \ | |
-d "$body" \ | |
https://api.travis-ci.org/repo/akvo%2Fakvo-flow-mobile/requests |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment