-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcircle.yml
87 lines (70 loc) · 3.32 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
machine:
node:
version: 0.12.2
java:
version: oraclejdk8
environment:
ELASTICSEARCH_HOST: "127.0.0.1"
ES_PORT: "9200"
LC_ALL: "C"
services:
- docker
checkout:
post:
- git submodule init
- git submodule update
dependencies:
cache_directories:
- "~/.meteor"
- "~/.npm"
override:
# BUILD DOCKER IMAGES
- docker info
# -------------------
# Mongo2ES ----------
- docker build -t kuknito/mongo2es .
# -------------------
# -- CACHE METEOR --
# Restore the meteor symlink
- if [ -d ~/.meteor ]; then sudo ln -s ~/.meteor/meteor /usr/local/bin/meteor; fi
# Install Meteor if the cache didn't restore it
- if [ ! -e ~/.meteor/meteor ]; then curl https://install.meteor.com | sh; fi
# -- CACHE VELOCITY CLI --
- npm install velocity-cli -g
test:
override:
# RUN DOCKER CONTAINERS
# MongoDB -------------
- docker run --name MongoDB -p 27018:27018 -d mongo:3.0 mongod --port 27018 --replSet "rs"
- sleep 2
- curl --retry 10 --retry-delay 5 -v http://localhost:27018 ; if [ $? != 0 ] ; then sudo apt-get install traceroute ; HOSTNAME=localhost; ping -c 10 $HOSTNAME > $CIRCLE_ARTIFACTS/network-report.log ; traceroute $HOSTNAME >> $CIRCLE_ARTIFACTS/network-report.log ; fi
- sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' MongoDB)" -- bash -c "mongo --port 27018 --eval \"rs.initiate()\""
# ---------------------
# ElasticSearch -------
- docker run --name ElasticSearch -d -p 9200:9200 -p 9300:9300 elasticsearch
- sleep 2
- curl --retry 10 --retry-delay 5 -v http://localhost:9200 ; if [ $? != 0 ] ; then sudo apt-get install traceroute ; HOSTNAME=localhost; ping -c 10 $HOSTNAME > $CIRCLE_ARTIFACTS/network-report.log ; traceroute $HOSTNAME >> $CIRCLE_ARTIFACTS/network-report.log ; fi
# ---------------------
# Mongo2ES ------------
- docker run --name Mongo2ES -d -e ROOT_URL=http://localhost:3001 -e MONGO_URL="mongodb://172.17.42.1:27018/kuknito?replicaSet=rs&readPreference=primaryPreferred&w=majority&connectTimeoutMS=60000&socketTimeoutMS=60000" -e MONGO_OPLOG_URL=mongodb://172.17.42.1:27018/local -e elasticsearchHost=http://172.17.42.1:9200 -p 3001:80 kuknito/mongo2es
- sleep 2
- curl --retry 10 --retry-delay 5 -v http://localhost:3001 ; if [ $? != 0 ] ; then sudo apt-get install traceroute ; HOSTNAME=localhost; ping -c 10 $HOSTNAME > $CIRCLE_ARTIFACTS/network-report.log ; traceroute $HOSTNAME >> $CIRCLE_ARTIFACTS/network-report.log ; fi
# ---------------------
# PACKAGE TESTING using velocity-cli
- velocity test-packages --port 3500 --ci:
environment:
elasticsearchHost: "http://localhost:9200"
VELOCITY_DEBUG: true
VELOCITY_CI: true
# create artifacts
- mkdir -p $CIRCLE_ARTIFACTS/chrome
# - cp .meteor/local/log/*.log $CIRCLE_ARTIFACTS/chrome
# save docker logs
- docker kill Mongo2ES && docker logs -f Mongo2ES > $CIRCLE_ARTIFACTS/mongo2es.log
- docker kill ElasticSearch && docker logs -f ElasticSearch > $CIRCLE_ARTIFACTS/elasticsearch.log
- docker kill MongoDB && docker logs -f MongoDB > $CIRCLE_ARTIFACTS/mongodb.log
deployment:
dockerhub:
branch: master
commands:
- curl --data build=true -X POST https://registry.hub.docker.com/u/alino/mongo2es/trigger/1c0523aa-e635-41c0-9e3e-fa465d2d4d83/