forked from gitcoinco/web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
67 lines (60 loc) · 1.94 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
63
64
65
66
67
sudo: false
language: python
python:
- 3.6
node_js:
- "9"
os:
- linux
services:
- docker
cache:
directories:
- $HOME/.cache/pip
- node_modules
jobs:
include:
# Lint and test the repository.
- stage: lint-test
script:
# Setup Env.
- cp app/app/travis.env app/app/.env
- pip install codecov
# Install Node and Python dependencies.
- npm install
- pip install -r requirements/test.txt
- npm run eslint
- npm run stylelint
- pytest -p no:ethereum
# Publish CodeCov coverage results.
- codecov
env:
- PYTHONPATH="${TRAVIS_BUILD_DIR}/app/"
- DJANGO_SETTINGS_MODULE="app.settings"
# Deploy to Docker Hub and initiate a rolling update for web.
- stage: deploy-stage
if: branch = master AND NOT type = pull_request
script:
# Authenticate with Docker Hub.
- echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
# Pull Docker images.
- docker pull python:3.6-slim-jessie
# Build, tag, and publish the new gitcoin/web image.
- docker build -t gitcoin/web:${TRAVIS_BUILD_NUMBER} .
- docker push gitcoin/web:${TRAVIS_BUILD_NUMBER}
- docker tag gitcoin/web:${TRAVIS_BUILD_NUMBER} gitcoin/web:latest
- docker push gitcoin/web:latest
- stage: deploy-prod
if: branch = stable
script:
# Authenticate with Docker Hub.
- echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
# Pull Docker images.
- docker pull python:3.6-slim-jessie
# Build, tag, and publish the new gitcoin/web image.
- docker build -t gitcoin/web:${TRAVIS_BUILD_NUMBER} .
- docker push gitcoin/web:${TRAVIS_BUILD_NUMBER}
- docker tag gitcoin/web:${TRAVIS_BUILD_NUMBER} gitcoin/web:stable
- docker push gitcoin/web:stable
addons:
postgresql: "9.6"