diff options
Diffstat (limited to '')
| -rw-r--r-- | .travis.yml | 6 | ||||
| -rw-r--r-- | deploy.py | 16 | ||||
| -rw-r--r-- | requirements-ci.txt | 17 | 
3 files changed, 27 insertions, 12 deletions
diff --git a/.travis.yml b/.travis.yml index e0efa08a..30032dfe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,11 @@  language: python  python:    - "3.6" -  +  install:    - pip install -r requirements.txt    - pip install -r requirements-ci.txt  script:    - snekchek  after_success: -  - | -    test $TRAVIS_BRANCH = "master" && -    "curl $AUTODEPLOY_WEBHOOK -H \"token: $AUTODEPLOY_TOKEN\"" +  - python 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") diff --git a/requirements-ci.txt b/requirements-ci.txt index 04e3aabe..50d0f297 100644 --- a/requirements-ci.txt +++ b/requirements-ci.txt @@ -1,9 +1,10 @@ -snekchek  -flake8  -flake8-bugbear  -flake8-bandit  -flake8-import-order  -flake8-tidy-imports  -flake8-string-format  -safety  +snekchek +flake8 +flake8-bugbear +flake8-bandit +flake8-import-order +flake8-tidy-imports +flake8-string-format +safety  dodgy +requests  |