This repository has been archived by the owner on Jul 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
44 lines (44 loc) · 3.04 KB
/
circle.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
machine:
pre:
- echo 'DOCKER_OPTS="-s btrfs -e lxc -D --userland-proxy=false"' | sudo tee -a /etc/default/docker
- sudo curl -L -o /usr/bin/docker 'https://s3-external-1.amazonaws.com/circle-downloads/docker-1.9.1-circleci-cp-workaround'
- sudo chmod 0755 /usr/bin/docker
services:
- docker
dependencies:
pre:
- sudo apt-get update && sudo apt-get install jq openssl curl
# download update_service script
- curl -LO https://raw.githubusercontent.com/gaia-adm/gaia-fleet/master/update_service.sh && chmod +x update_service.sh
override:
- docker build -t gaiaadm/result-upload-service .
- docker tag gaiaadm/result-upload-service gaiaadm/result-upload-service:$CIRCLE_BUILD_NUM-$CIRCLE_BRANCH
- docker tag gaiaadm/result-upload-service gaiaadm/result-upload-service:$CIRCLE_BRANCH
test:
override:
- docker run -d --name rabbitmq -e "RABBITMQ_PASS=admin" gaiaadm/rabbitmq; sleep 10
# run etcd since we are not on coreos
- docker run -d --name etcd microbox/etcd:2.1.1 -name etcd --listen-client-urls 'http://0.0.0.0:4001' --advertise-client-urls 'http://0.0.0.0:4001'; sleep 5
- docker run -d -u jetty --link etcd:etcd -e etcdUrl="http://etcd:4001" -e noDex=true --name sts gaiaadm/sts; sleep 10
# run jshint
- docker run --name jshint-runner gaiaadm/result-upload-service grunt jshint
# run system tests
- docker run -e AMQ_USER="admin" -e AMQ_PASSWORD="admin" -e AMQ_SERVER="rabbitmq:5672" -e STORAGE_PATH="/tmp" -v "/tmp:/tmp" --link rabbitmq:rabbitmq --link sts:sts --name system-test-runner gaiaadm/result-upload-service grunt system
- docker cp system-test-runner:/src/system-test-results.xml $CIRCLE_TEST_REPORTS
- docker cp system-test-runner:/src/system-test-results.txt $CIRCLE_ARTIFACTS
# run result-upload-service as demon for rest tests
- docker run -d -e AMQ_USER="admin" -e AMQ_PASSWORD="admin" -e AMQ_SERVER="rabbitmq:5672" -e AUTH_SERVER="sts:8080" -e STORAGE_PATH="/tmp" -v "/tmp:/tmp" --link rabbitmq:rabbitmq --link sts:sts --name result-upload-service gaiaadm/result-upload-service; sleep 10
# run rest tests
- docker run -e AMQ_USER="admin" -e AMQ_PASSWORD="admin" -e AMQ_SERVER="rabbitmq:5672" -e AUTH_SERVER="sts:8080" -e SERVICE_HOST="result-upload-service" -e STORAGE_PATH="/tmp" -v "/tmp:/tmp" --link result-upload-service:result-upload-service --link rabbitmq:rabbitmq --link sts:sts --name rest-test-runner gaiaadm/result-upload-service grunt rest
- docker cp rest-test-runner:/src/rest-test-results.xml $CIRCLE_TEST_REPORTS
- docker cp rest-test-runner:/src/rest-test-results.txt $CIRCLE_ARTIFACTS
deployment:
continuous:
branch: [master, develop, /.*feature_.*/]
commands:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker push gaiaadm/result-upload-service
- ./update_service.sh -t $CIRCLE_BRANCH -b $CIRCLE_BUILD_NUM -f result-upload-service.service -n result-upload-service
notify:
webhooks:
- url: https://webhook.master.gaiahub.io/wh/5a866f9b-98c9-438d-a8d4-53cf4ae9599c/4c310c8e220ee9bead74eece42ce0e109fd3535e