forked from mozilla/kitsune
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
42 lines (39 loc) · 1.71 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
sudo: required
language: python
python: 2.7
services:
- docker
before_install:
- echo "ENV GIT_SHA ${TRAVIS_COMMIT}" >> Dockerfile
- export GIT_SHA=${TRAVIS_COMMIT}
- docker pull itsre/sumo-kitsune:full-latest
install:
- pip install -U docker-compose
- cp .env-travis .env
- docker-compose up -d mariadb
- docker-compose up -d elasticsearch
- docker-compose up -d redis
# Docker always copies data as root. Chowning files to root before the build
# command will prevent docker cache invalidation due to different file
# metadata. Once Travis updates to the latest docker version we should
# probably use --chown flag for COPY. See https://github.com/moby/moby/pull/34263
- sudo chown -c 0:0 -R requirements package.json bower.json
- sudo chmod -c a+rw -R requirements package.json bower.json
# For some strange reason `docker-compose build` -even with the above chown
# trick- still invalidates the cache at the COPY command. Directly building
# with `docker build` works.
- docker build -t kitsune:latest --cache-from itsre/sumo-kitsune .
- docker-compose run --user root web ./manage.py nunjucks_precompile
- docker-compose run --user root web ./manage.py compilejsi18n
- docker-compose run --user root web ./manage.py collectstatic --noinput
script:
- docker-compose run --user root web flake8 kitsune
- docker-compose run --user root web ./node_modules/.bin/mocha --compilers js:babel/register --recursive kitsune/*/static/*/js/tests/* $@
- docker-compose run --user root -e REUSE_STATIC=1 web ./manage.py test --noinput --nologcapture -a '!search_tests' --with-nicedots
notifications:
email: false
irc:
channels:
- irc.mozilla.org#sumodev
on_success: always
on_failure: always