diff options
-rw-r--r-- | .travis.yml | 6 | ||||
-rw-r--r-- | deploy.py | 20 |
2 files changed, 23 insertions, 3 deletions
diff --git a/.travis.yml b/.travis.yml index b02057162..0782e5a19 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,16 @@ language: python python: - "3.6" - + install: - pip install -r requirements.txt - pip install -r requirements-ci.txt script: - snekchek after_success: - "curl $AUTODEPLOY_WEBHOOK -H \"token: $AUTODEPLOY_TOKEN\"" + - python deploy.py notifications: email: on_success: never - on_failure: never
\ No newline at end of file + on_failure: never diff --git a/deploy.py b/deploy.py new file mode 100644 index 000000000..1f0ca19ca --- /dev/null +++ b/deploy.py @@ -0,0 +1,20 @@ +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") |