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 3
/
circle.yml
42 lines (42 loc) · 1.82 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
machine:
# pre section is a workaround for https://discuss.circleci.com/t/unable-to-use-docker-cp-but-it-worked-2-days-ago/1137/9
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/mgs.war ./target/mgs.war
- cp Dockerfile.run Dockerfile
- docker build -t gaiaadm/mgs .
- docker tag gaiaadm/mgs gaiaadm/mgs:$CIRCLE_BUILD_NUM-$CIRCLE_BRANCH
- docker tag gaiaadm/mgs gaiaadm/mgs:$CIRCLE_BRANCH
test:
override:
- docker run -d -p 9002:8080 gaiaadm/mgs; sleep 10
# docker run -d --link sts:sts -e useAmqp=true -e authServer=sts:8080 -p 9002:8080 --name mgs gaiaadm/mgs
- curl -i http://localhost:9002/mgs/ | grep "200 OK"
deployment:
continuous:
branch: [master, develop, /.*feature_.*/]
commands:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker push gaiaadm/mgs
- ./update_service.sh -t $CIRCLE_BRANCH -b $CIRCLE_BUILD_NUM -f metrics-gateway-service.service -n mgs
notify:
webhooks:
- url: https://webhook.master.gaiahub.io/wh/5a866f9b-98c9-438d-a8d4-53cf4ae9599c/4c310c8e220ee9bead74eece42ce0e109fd3535e
general:
artifacts:
- target/mgs.war