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
/
Copy pathcircle.yml
47 lines (47 loc) · 2.74 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
45
46
47
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
# download update_service script
# - curl -LO https://raw.githubusercontent.com/gaia-adm/gaia-fleet/master/update_service.sh && chmod +x update_service.sh
override:
- cp Dockerfile Dockerfile.run
- cp Dockerfile.build Dockerfile
- docker build -t build-img .
- docker create --name build-cont build-img
- mkdir -p ./target
- docker cp build-cont:/usr/local/gaia/target/events-indexer-1.0-SNAPSHOT.jar ./target/events-indexer-1.0-SNAPSHOT.jar
- cp Dockerfile.run Dockerfile
- docker build -t gaiaadm/event-indexer .
- docker tag gaiaadm/event-indexer gaiaadm/event-indexer:$CIRCLE_BUILD_NUM-$CIRCLE_BRANCH
- docker tag gaiaadm/event-indexer gaiaadm/event-indexer:$CIRCLE_BRANCH
test:
override:
- docker run -d -p 5673:5672 -p 15673:15672 -e RABBITMQ_PASS="mypass" --name rabbitmq tutum/rabbitmq
- docker run -d -p 8083:8083 -p 8086:8086 -e PRE_CREATE_DB="db1" --name influxdb tutum/influxdb
- docker run -d -p 8080:8080 -p 8081:8081 --link rabbitmq:rabbitmq --link influxdb:influxdb --name indexer gaiaadm/event-indexer:$BUILD_TAG java -Ddw.rabbitmq.username=admin -Ddw.rabbitmq.password=mypass -jar /data/target/events-indexer-1.0-SNAPSHOT.jar server
- docker run -d -p 9000:8080 -p 9001:8081 --link rabbitmq:rabbitmq --name faker gaiaadm/data-faker java -Ddw.rabbitmq.username=admin -Ddw.rabbitmq.password=mypass -jar /data/target/data-faker-1.0-SNAPSHOT.jar server
- sleep 5
- "curl --data 'my_time_series,status=open value=12345 17345536544792478' 'http://localhost:9000/fake-data?repeat=2&sendto=rabbitmq&routingkey=events-indexer&exchangename=EMPTYSTRING'"
- sleep 5
- "curl -G 'http://localhost:8086/query' --data-urlencode 'db=db1' --data-urlencode 'u=root' --data-urlencode 'p=root' --data-urlencode 'q=SELECT * FROM my_time_series' | grep 'open' | grep '12345'"
deployment:
continuous:
branch: [master, develop, /feature_.*/]
commands:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker push gaiaadm/event-indexer
# We removed this service from production!
#- ./update_service.sh -t $CIRCLE_BRANCH -b $CIRCLE_BUILD_NUM -f events-indexer.service -n event-indexer
general:
artifacts:
- target/event-indexer.jar
notify:
webhooks:
- url: https://webhook.master.gaiahub.io/wh/5a866f9b-98c9-438d-a8d4-53cf4ae9599c/4c310c8e220ee9bead74eece42ce0e109fd3535e