[CI] Added support for conditional builds and env vars (#1320)

* Changed travis deploy scheme

* Fixed indentation

* Okay NOW I did fix indentation (hopefully)

* Conditional deployment tests

* Fixed a 7:35 AM typo

* Fixed builds not building.
This commit is contained in:
Kowlin 2018-02-26 06:10:55 +01:00 committed by palmtree5
parent 0593bb9c53
commit 21de95e0a6
2 changed files with 38 additions and 29 deletions

View File

@ -1,24 +1,35 @@
dist: trusty
language: python
cache: pip
notifications:
email: false
python:
- 3.5.3
- 3.6.1
install:
- echo "pytest>3" >> requirements.txt
- echo "pytest-asyncio" >> requirements.txt
- echo "git+https://github.com/Rapptz/discord.py.git@rewrite#egg=discord.py[voice]"
>> requirements.txt
- echo "git+https://github.com/Rapptz/discord.py.git@rewrite#egg=discord.py[voice]" >> requirements.txt
- pip install -r requirements.txt
- pip install .
script:
- python -m compileall ./redbot/cogs
- python -m pytest
before_deploy:
- curl https://artifacts.crowdin.com/repo/GPG-KEY-crowdin | sudo apt-key add -
- echo "deb https://artifacts.crowdin.com/repo/deb/ /" | sudo tee -a /etc/apt/sources.list
- sudo apt-get update -qq
- sudo apt-get install -y crowdin
deploy:
jobs:
include:
- stage: Deployment
if: tag IS present
python: 3.5.3
env:
- DEPLOYING=true
before_deployment:
- curl https://artifacts.crowdin.com/repo/GPG-KEY-crowdin | sudo apt-key add -
- echo "deb https://artifacts.crowdin.com/repo/deb/ /" | sudo tee -a /etc/apt/sources.list
- sudo apt-get update -qq
- sudo apt-get install -y crowdin
deploy:
- provider: pypi
user: Red-DiscordBot
password:
@ -37,6 +48,3 @@ deploy:
branch: V3/develop
python: 3.5.3
tags: true
cache: pip
notifications:
email: false

View File

@ -8,6 +8,7 @@ import sys
from setuptools import find_packages
IS_TRAVIS = 'TRAVIS' in os.environ
IS_DEPLOYING = 'DEPLOYING' in os.environ
dep_links = ['https://github.com/Rapptz/discord.py/tarball/rewrite#egg=discord.py-1.0']
if IS_TRAVIS:
@ -22,7 +23,7 @@ def get_package_list():
def get_requirements():
with open('requirements.txt') as f:
requirements = f.read().splitlines()
if IS_TRAVIS:
if IS_TRAVIS and not IS_DEPLOYING:
requirements.remove('git+https://github.com/Rapptz/discord.py.git@rewrite#egg=discord.py[voice]')
else:
requirements.append('discord.py>=1.0.0a0') # Because RTD