diff options
author | 2018-02-07 23:07:59 +0100 | |
---|---|---|
committer | 2018-02-07 23:07:59 +0100 | |
commit | aaf007a9b07d81cd47dca157807c079ea4c561ea (patch) | |
tree | fa592f46024709f5d83cff62849f172d2fa2b5d8 /deploy.py | |
parent | only deploy on master branch (#4) (diff) |
Travis deploy on master (#5)
* adds python script to handle branch condition
Diffstat (limited to 'deploy.py')
-rw-r--r-- | deploy.py | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -7,9 +7,14 @@ branch = os.environ.get("TRAVIS_BRANCH") url = os.environ.get("AUTODEPLOY_WEBHOOK") token = os.environ.get("AUTODEPLOY_TOKEN") -if branch == 'master': +PR = os.environ.get("TRAVIS_PULL_REQUEST") + +print('branch:', branch) +print('is_pr:', PR) + +if branch == 'master' and PR == 'false': print("deploying..") - result = requests.post(url=url, headers={'token': token}) + result = requests.get(url=url, headers={'token': token}) print(result.text) else: |