aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christopher Baklid <[email protected]>2018-02-10 09:07:30 +0100
committerGravatar GitHub <[email protected]>2018-02-10 09:07:30 +0100
commita3d37a38524895289ceaf0a48a58457874487e4a (patch)
tree68007e2dd6a9bcb41792622f60f9a56f1957f0d0
parentMerge pull request #4 from discord-python/readd-c-modules (diff)
only deploy on master (#5)
* only deploy on master
-rw-r--r--.travis.yml6
-rw-r--r--deploy.py20
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")