Skip to content

Instantly share code, notes, and snippets.

@valllllll2000
Created February 14, 2019 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save valllllll2000/a4aecfb76f2edf8153514a41a9a1cdd7 to your computer and use it in GitHub Desktop.
Save valllllll2000/a4aecfb76f2edf8153514a41a9a1cdd7 to your computer and use it in GitHub Desktop.
trigger travis to deploy app to instance
#!/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