From aaf007a9b07d81cd47dca157807c079ea4c561ea Mon Sep 17 00:00:00 2001 From: Christopher Baklid Date: Wed, 7 Feb 2018 23:07:59 +0100 Subject: Travis deploy on master (#5) * adds python script to handle branch condition --- deploy.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'deploy.py') diff --git a/deploy.py b/deploy.py index 4e45b1f0..189b5f0c 100644 --- a/deploy.py +++ b/deploy.py @@ -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: -- cgit v1.2.3