forked from yorrick/download-data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
56 lines (46 loc) · 1.75 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
sudo: required
language: python
cache: pip
python:
- "2.7"
install:
- pip install -r requirements.txt
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
services:
- docker
env:
DOCKER_COMPOSE_VERSION: 1.7.0
DOCKER_IMAGE_NAME: yorrick/download-data
before_install:
- sudo apt-get update -y
- sudo apt-get -o Dpkg::Options::="--force-confnew" install -y docker-engine
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
script:
- nosetests --with-coverage # unit tests
- ./extract/parse_downloads.py data data && mv data/110302-sample.log.csv data/all.log.csv # integration tests
- docker-compose up -d # start docker postgres
- sleep 15
- docker-compose run psql -f /sql/build_database.sql # test database creation
- docker-compose run psql -f /sql/tests.sql # database sanity checks
- export TAG=`if [ ! -z "$TRAVIS_TAG" ]; then echo $TRAVIS_TAG; else echo "latest" ; fi`
- echo $TAG
- echo $DOCKER_IMAGE_NAME
- echo $TRAVIS_COMMIT
- docker build -t $DOCKER_IMAGE_NAME:$TRAVIS_COMMIT .
- docker tag $DOCKER_IMAGE_NAME:$TRAVIS_COMMIT $DOCKER_IMAGE_NAME:$TAG
- docker tag $DOCKER_IMAGE_NAME:$TRAVIS_COMMIT $DOCKER_IMAGE_NAME:travis-$TRAVIS_BUILD_NUMBER
- docker push $DOCKER_IMAGE_NAME
after_success:
- coveralls
notifications:
hipchat:
rooms:
- 9ba0dc0f9d8f62990243747a810872@download-data
template:
- '%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message}'
notify: true
on_success: change
on_failure: change