forked from zauberware/rails-devise-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitbucket-pipelines.yml
56 lines (54 loc) · 1.92 KB
/
bitbucket-pipelines.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
# This is a sample build configuration for Ruby.
# Check our guides at https://confluence.atlassian.com/x/8r-5Mw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: ruby:2.6.5
definitions:
steps:
- step: &run-audit
name: Check Vulnerabilities
script:
- gem install bundler-audit
- bundle audit --update
- step: &run-tests
name: Run tests
caches:
- bundler
script:
- export DATABASE_URL=postgresql://test_user:test_user_password@localhost/ci_test
- cp config/database.ci.yml config/database.yml
- bundle install --path vendor/bundle
- bundle exec rake db:setup
- bundle exec rake db:test:prepare
- bundle exec rspec spec
services:
- postgres
caches:
bundler: vendor/bundle
services:
postgres:
image: postgres
environment:
POSTGRES_DB: ci_test
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_user_password
pipelines:
pull-requests:
"**":
- step: *run-tests
branches:
develop:
- step: *run-tests
- step:
name: Deploy to Staging
deployment: staging
script:
- git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git develop:master
master:
- step: *run-tests
- step:
name: Deploy to Production
deployment: production
script:
- git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git master