forked from cuulee/picluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
46 lines (41 loc) · 2.95 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
language: generic
services:
- docker
env:
- DOCKER_COMPOSE_VERSION=1.16.1
before_install:
- sudo apt-get -qq update
- sudo apt-get remove -y docker docker-engine docker.io
- sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common libgmp10
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository -y "deb [arch=amd64] https://download.docker.com/linux/ubuntu
$(lsb_release -cs) stable"
- sudo apt-get -qq update
- sudo apt-get install -y docker-ce
- sudo curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /tmp/docker-compose
- sudo mv /tmp/docker-compose /usr/local/bin/docker-compose
- sudo chmod +x /usr/local/bin/docker-compose
- curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
- sudo apt-get install -y nodejs
- cd /tmp;curl -O http://mirrors.kernel.org/ubuntu/pool/universe/s/shellcheck/shellcheck_0.3.3-1~ubuntu14.04.1_amd64.deb && sudo dpkg -i shellcheck_0.3.3-1~ubuntu14.04.1_amd64.deb;cd $OLDPWD;
script:
- npm install --unsafe-perm
- npm test
- IP=`ip addr show | grep -i eth0 | grep -i inet | cut -d ' ' -f 6 | cut -d '/' -f1`
- cp -r ./example/x86_64/ubuntu/* ./docker/
- sudo docker image build ./docker/nginx -t nginx -f ./docker/nginx/Dockerfile
- sudo docker image build . -t local/testing:alpine -f web/tests/integration/Dockerfile.alpine
- sudo docker container run -d --name nginx -p 80:80 nginx
- sudo find . -name "node_modules" -exec rm -rf {} \; || true
- sudo docker-compose up -d
- sudo docker-compose ps
- echo "Waiting for PiCluster on ${IP}...";let i=1;until $(curl --output /dev/null --silent --head --fail http://$IP:3003); do i=$((i+1)); printf '.'; sleep 5; if [ "$i" -eq 60 ] ; then exit 1; fi; done
- sleep 30 && sudo docker run -it --rm -v "$PWD:$PWD" -w "$PWD/web/tests/integration" -e URL=http://$IP:3003
-e FONTLINUX=fl-alpine local/testing:alpine
- shellcheck pictl
- chmod +x ./pictl
- for container in $(sudo docker-compose ps -q) ; do json=$(sudo docker inspect $container); if [ "$(jq '.[0].State.Running' <<< $json)" != "true" ] ; then sudo docker-compose logs "$(jq -r '.[0].Config.Labels."com.docker.compose.service"' <<< $json)"; fi; done
- sudo docker-compose down
notifications:
slack:
secure: cYlopFAlFeNzjKTK7XyN/P4fsFXejs459f6c1B+IRv2v9hgIOEhTvR1iFFJmaiWdCje/ws47MnVMj6NJiBmaiC1L34BsWRtQhNN6j/bINpCAHF7nfSzS1amiB5OgskTEQ+BHAmjNvSj+EmtLiWfixJpEFkH3P4VXqZXRTas1wYCWQVnBN08BRL5Jz3rNJhNVwhGBpWZByeAD03xcUnuYQ976/ZLX8DRwCbRtCgmHxBRnvYOY+5fgtNPffDZtb4zyFNhZz1Huqqpm9g4K438lx/zOONch8+1q8Y/rvSYKNu61LrZrZ2EhIwkLbCLthosm2ZpsbqlVBrRsZB6sXlcedmNkp7ZrX4VVEIbTYk7rp2JXRddo1P1Q5jDxVc1cIMIDwaTaY7mOZQ5sUr0GWo/Npk53/EHZMKyv/bBX0S5q2aCV8uCaU/ben5pzY7rHr6JhACDciFgvM+rYTI39EOemIHgJFRbbrYHaUVQF2FsVAVFiGyjh9AoLpW/3nWas/kv1Wz26/Qk8EvHklq3BzniUYInByfYcqk5KYQ/VXr/f2kYgIYi6BM3W/Wx0o1+ouGxhbULuNSF9T4yV/G+Ta4BGcGayjqiYGjYKD2+oKbOp05gsgaw+SRrHvqhCDsZRc2kRzFzCm5KmfHi/jbMR1N90on6pHy0s3kGjtuAOLAjG1do=