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
45 lines (45 loc) · 2.69 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
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
node:
version: 4.4.6
services:
- postgresql
- docker
dependencies:
pre:
- sudo apt-get update && sudo apt-get install
# download update_service script
- curl -LO https://raw.githubusercontent.com/gaia-adm/gaia-fleet/master/update_service.sh && chmod +x update_service.sh
override:
# build test image
- docker build -t gaiaadm/acmserver:test --build-arg "NODE=test" .
# build production image
- docker build -t gaiaadm/acmserver .
# tag production image with build build labels
- docker tag gaiaadm/acmserver gaiaadm/acmserver:$CIRCLE_BUILD_NUM-$CIRCLE_BRANCH
- docker tag gaiaadm/acmserver gaiaadm/acmserver:$CIRCLE_BRANCH
database:
override:
- createuser -s -d hpe_account_management_test
- createdb hpe_account_management_test
test:
override:
- docker run --rm -it -e DB_HOST=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d ' ' -f 3 | cut -d ':' -f 2) gaiaadm/acmserver:test knex migrate:latest --env test
- docker run -it --name test-runner -e DB_HOST=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d ' ' -f 3 | cut -d ':' -f 2) -e DB_DATABASE=hpe_account_management_test -e DB_USER=hpe_account_management_test -e INVITATION_EMAIL_FROM=postmaster@sandboxa9f9485dbc6b4430ac6a6ccef0ea6272.mailgun.org -e SMTP_PASSWORD=$SMTP_PASSWORD -e SMTP_USERNAME=postmaster@sandboxa9f9485dbc6b4430ac6a6ccef0ea6272.mailgun.org gaiaadm/acmserver:test npm test
- docker cp test-runner:/usr/src/app/test-results.xml $CIRCLE_TEST_REPORTS
- docker run -it --name dredd-runner -e DB_HOST=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d ' ' -f 3 | cut -d ':' -f 2) -e DB_DATABASE=hpe_account_management_test -e DB_USER=hpe_account_management_test -e INVITATION_EMAIL_FROM=postmaster@sandboxa9f9485dbc6b4430ac6a6ccef0ea6272.mailgun.org -e SMTP_PASSWORD=$SMTP_PASSWORD -e SMTP_USERNAME=postmaster@sandboxa9f9485dbc6b4430ac6a6ccef0ea6272.mailgun.org gaiaadm/acmserver:test dredd
deployment:
continuous:
branch: [master, develop, /.*feature_.*/]
commands:
# login to DockerHub
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
# push production image
- docker push gaiaadm/acmserver
- ./update_service.sh -t $CIRCLE_BRANCH -b $CIRCLE_BUILD_NUM -f acm-server.service -n acmserver
notify:
webhooks:
- url: https://webhook.master.gaiahub.io/wh/5a866f9b-98c9-438d-a8d4-53cf4ae9599c/4c310c8e220ee9bead74eece42ce0e109fd3535e