From 85afb2dc4159a3eaae5c21289efdd2eb97685fc3 Mon Sep 17 00:00:00 2001 From: Christopher Baklid Date: Wed, 7 Feb 2018 22:55:42 +0100 Subject: only deploy on master branch (#4) * adds python script to handle branch condition * satisfy snekchek * snekchekd to death --- deploy.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 deploy.py (limited to 'deploy.py') diff --git a/deploy.py b/deploy.py new file mode 100644 index 00000000..4e45b1f0 --- /dev/null +++ b/deploy.py @@ -0,0 +1,16 @@ +import os + +import requests + + +branch = os.environ.get("TRAVIS_BRANCH") +url = os.environ.get("AUTODEPLOY_WEBHOOK") +token = os.environ.get("AUTODEPLOY_TOKEN") + +if branch == 'master': + print("deploying..") + result = requests.post(url=url, headers={'token': token}) + print(result.text) + +else: + print("skipping deploy") -- cgit v1.2.3