-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
60 lines (52 loc) · 2.23 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
dist: alpine
sudo: required
services:
- docker
# Get Google Chrome headless browser for Angular tests
# Install latest Docker CE so we can use Dockerfile outside build context
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
- docker-ce
# Install any dependencies, update Docker Compose to 1.23.2 so we can use Dockerfile outside build context
before_install:
# - "export DISPLAY=:99.0"
# - sh -e /etc/init.d/xvfb start
- docker --version
- docker-compose --version
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/1.23.2/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- docker-compose --version
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
- sudo touch /etc/apt/sources.list.d/google.list
- sudo chmod 777 /etc/apt/sources.list.d/google.list
- echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list
- sudo apt-get update
- sudo apt-get install -y google-chrome-stable xvfb
- sudo apt-get install -y libgbm-dev libgconf-2-4 libatk1.0-0 libatk-bridge2.0-0 libgdk-pixbuf2.0-0 libgtk-3-0 libgbm-dev libnss3-dev libxss-dev libasound2
- export CHROME_BIN=/usr/bin/google-chrome
- echo $CHROME_BIN
# - ls -la /usr/local/bin/
# - ls -la /opt/google/chrome/
# - ls -la /usr/bin/google*
#install:
# Build development images for test
before_script:
- docker build ./todo-view -f ./todo-view/Dockerfile.dev -t nfarshid/todo-view-test
- docker build ./todo-cache-service -f Dockerfile.nodejs.dev -t nfarshid/todo-cache-service-test
# Run some tests
script:
- docker run nfarshid/todo-view-test npm test -- --watch=false --no-progress --browsers=ChromeHeadlessNoSandbox
- docker run nfarshid/todo-cache-service-test npm test
after_success:
# Build Production Images for deployment
- docker-compose -f docker-compose.yml -f docker-compose.prod.yml build
# Login to Docker Hub
- echo "$DOCKER_HUB_PASSWORD" | docker login -u "$DOCKER_HUB_ID" --password-stdin
# Take the built production images and push to Docker Hub
- docker-compose -f docker-compose.yml -f docker-compose.prod.yml push