-
-
Save cionman/1faaca7561702db4cdd8c534cd0a5181 to your computer and use it in GitHub Desktop.
Django .travis.yml example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 어떤 언어를 사용할 지 정의 합니다. | |
language: python | |
# 사용할 파이썬 버전을 적어줍니다. | |
python: | |
- "3.4" | |
- "3.5" | |
# command to install dependencies | |
# OS(trusty - Ubuntu 14.0.4 LTS)와 기타 환경설정을 정의 합니다. | |
## MySQL과 Firefox를 추가한 것을 확인 하실 수 있습니다. | |
dist: trusty | |
sudo: required | |
addons: | |
apt: | |
packages: | |
- mysql-server-5.6 | |
- mysql-client-core-5.6 | |
- mysql-client-5.6 | |
firefox: "45.0.2" | |
# 환경변수를 설정합니다. | |
## matrix 옵션에서 빌드별 장고 버전을 명시했습니다. | |
env: | |
global: | |
- BUILD_ON_TRAVIS=true | |
matrix: | |
- DJANGO_VERSION=1.8.12 DB=mysql | |
- DJANGO_VERSION=1.9.4 DB=mysql | |
- DJANGO_VERSION=1.9.5 DB=mysql | |
# Dependency 설정전에 실행할 스크립트를 입력합니다. | |
## 아래는 Xvfb를 실행하도록 스크립트를 설정했습니다. | |
before_install: | |
- "export DISPLAY=:99.0" | |
- "sh -e /etc/init.d/xvfb start" | |
- sleep 3 # give xvfb some time to start | |
# 빌드에 사용될 Dependency를 설정하는 부분입니다. | |
## 기본적으로 requirments.txt 에 있는 dependency를 설치한 뒤, | |
## django버전을 빌드별로 설정했습니다. | |
install: | |
- pip install -r requirements.txt | |
- pip install -q Django==$DJANGO_VERSION | |
# 빌드 스크립트를 실행하기전에 사용할 명령들입니다. | |
## mysql에 model_test라는 DB를 만든뒤 migration 파일을 만들도록 했습니다. | |
before_script: | |
- mysql -u root -e 'create database model_test;' | |
- python manage.py makemigrations | |
# 빌드에 사용할 스크립트입니다. | |
## 전 migrate와 test가 정상적으로 동작하는 지 확인 할 수 있도록 했습니다. | |
script: | |
- python manage.py migrate -v 3 | |
- python manage.py test -v 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment