aboutsummaryrefslogtreecommitdiffstats
path: root/deploy.py
blob: 189b5f0ce15a749ea38b7680b3eac60422e3beef (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import os

import requests


branch = os.environ.get("TRAVIS_BRANCH")
url = os.environ.get("AUTODEPLOY_WEBHOOK")
token = os.environ.get("AUTODEPLOY_TOKEN")

PR = os.environ.get("TRAVIS_PULL_REQUEST")

print('branch:', branch)
print('is_pr:', PR)

if branch == 'master' and PR == 'false':
    print("deploying..")
    result = requests.get(url=url, headers={'token': token})
    print(result.text)

else:
    print("skipping deploy")