forked from decide-ganimedes/decide-ganimedes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
62 lines (51 loc) · 1.87 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
############################################################
## Variables: #
## #
## DEPLOY_TRAVIS ------> 1 para activar releases #
## USER_TRAVIS --------> usuario de github #
## EMAIL_TRAVIS -------> email de github #
## MILESTONE_TRAVIS ---> número de milestone #
## NOMBRE_ZIP ---------> decide #
## RAMA_TRAVIS --------> master #
## TOKEN_TRAVIS -------> token personal sin encriptar #
############################################################
language: python
python:
- 3.6
sudo: required
dist: trusty
addons:
postgresql: "9.6"
services:
- postgresql
env:
- DJANGO_SETTINGS_MODULE="decide.settings"
install:
- pip install -r requirements.txt
before_script:
- psql -c "create user decide with password 'decide'" -U postgres
- psql -c "create database decide owner decide" -U postgres
script:
- python ./decide/manage.py makemigrations
- python ./decide/manage.py migrate
# - python ./decide/manage.py compilemessages
- python ./decide/manage.py test ./decide
- if [[ $TRAVIS_BRANCH == $RAMA_TRAVIS ]] && [[ $DEPLOY_TRAVIS == "1" ]]; then git archive --format zip --output ./$NOMBRE_ZIP.zip $RAMA_TRAVIS; echo "Zip generado correctamente."; fi
before_deploy:
- git config --local user.name $USER_TRAVIS
- git config --local user.email $EMAIL_TRAVIS
- export YEAR=`date +"%Y"`
- export GIT_TAG=v$MILESTONE_TRAVIS.0.$TRAVIS_BUILD_NUMBER-$YEAR
- git tag -a $GIT_TAG -m "Generated tag from TravisCI build $TRAVIS_BUILD_NUMBER"
deploy:
provider: releases
api-key:
secure: $TOKEN_TRAVIS
file: "./$NOMBRE_ZIP.zip"
skip_cleanup: true
on:
branch: $RAMA_TRAVIS
condition: $DEPLOY_TRAVIS = 1
tags: false
notifications:
email: false