forked from mammooc/mammooc.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
60 lines (50 loc) · 2.26 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
general:
artifacts:
- "rubocop.html"
machine:
environment:
GEMNASIUM_TESTSUITE: "bundle check"
GEMNASIUM_PROJECT_SLUG: "mammooc/mammooc.org"
COVERALLS_PARALLEL: "true"
dependencies:
pre:
- "if [[ $CIRCLE_BRANCH == dev ]]; then sudo sh -c 'echo \"deb http://apt.gemnasium.com stable main\" > /etc/apt/sources.list.d/gemnasium.list'; else exit 0; fi;"
- "if [[ $CIRCLE_BRANCH == dev ]]; then sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com E5CEAB0AC5F1CA2A; else exit 0; fi;"
- "if [[ $CIRCLE_BRANCH == dev ]]; then sudo apt-get update; else exit 0; fi;"
- "if [[ $CIRCLE_BRANCH == dev ]]; then sudo apt-get install gemnasium-toolbelt; else exit 0; fi;"
test:
post:
- bundle exec rake rubocop:show
- "curl -H \"Content-Type: application/json\" --data \"{\\\"payload\\\": {\\\"build_num\\\": $CIRCLE_BUILD_NUM, \\\"status\\\": \\\"done\\\"} }\" -X POST https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN"
deployment:
production:
branch: master
commands:
# Docker
- "curl -H \"Content-Type: application/json\" --data '{\"build\": true}' -X POST $DOCKER_HUB_TRIGGER_URL"
# Heroku
- heroku maintenance:on --app mammooc
- git push [email protected]:mammooc.git
- heroku pg:reset DATABASE --app mammooc --confirm mammooc
- heroku run rake db:schema:load db:seed RAILS_ENV=development --app mammooc
- heroku restart --app mammooc
- heroku maintenance:off --app mammooc
development:
branch: dev
commands:
- heroku maintenance:on --app mammooc-dev
- git push [email protected]:mammooc-dev.git dev:master
- heroku pg:reset DATABASE --app mammooc-dev --confirm mammooc-dev
- heroku run rake db:schema:load db:seed RAILS_ENV=development --app mammooc-dev
- heroku restart --app mammooc-dev
- heroku maintenance:off --app mammooc-dev
# Gemnasium Auto-Update
- sh -c 'GEMNASIUM=true; gemnasium autoupdate run; exit 0'
teaser:
branch: teaser
commands:
- heroku maintenance:on --app mammooc-teaser
- git push [email protected]:mammooc-teaser.git teaser:master
- heroku run rake db:migrate --app mammooc-teaser
- heroku restart --app mammooc-teaser
- heroku maintenance:off --app mammooc-teaser