-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d88e3d4
commit ef781f5
Showing
3 changed files
with
79 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
version: 2 | ||
|
||
jobs: | ||
test: | ||
docker: | ||
- image: circleci/ruby:2.4.3 | ||
environment: | ||
DATABASE_URL: "postgres://ubuntu@localhost:5432/circle_ruby_test" | ||
- image: circleci/postgres:9.6.2-alpine | ||
environment: | ||
POSTGRES_USER: ubuntu | ||
POSTGRES_DB: circle_ruby_test | ||
environment: | ||
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts | ||
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results | ||
RAILS_ENV: test | ||
RACK_ENV: test | ||
steps: | ||
- checkout | ||
- run: mkdir -p $CIRCLE_ARTIFACTS $CIRCLE_TEST_REPORTS | ||
- restore_cache: | ||
keys: | ||
# This branch if available | ||
- v1-dep-{{ .Branch }}- | ||
# Default branch if not | ||
- v1-dep-master- | ||
# Any branch if there are none on the default branch - this should be unnecessary if you have your default branch configured correctly | ||
- v1-dep- | ||
- run: gem update --system | ||
- run: gem install bundler -v 1.16.1 | ||
- run: sed -i.bak "/gem ['\"]growl_notify\|autotest-fsevent\|rb-appscript\|rb-fsevent['\"].*, *$/ N; s/\n *//g; /gem ['\"]growl_notify\|autotest-fsevent\|rb-appscript\|rb-fsevent['\"]/ d" Gemfile | ||
- run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3 | ||
- save_cache: | ||
key: v1-dep-{{ .Branch }}-{{ epoch }} | ||
paths: | ||
# This is a broad list of cache paths to include many possible development environments | ||
# You can probably delete some of these entries | ||
- vendor/bundle | ||
- ~/.bundle | ||
- run: cp ./config/database.circle ./config/database.yml | ||
- run: | ||
name: Wait for DB | ||
command: dockerize -wait tcp://127.0.0.1:5432 -timeout 120s | ||
- run: bundle exec rake db:create db:schema:load --trace | ||
- run: bundle exec rake ci | ||
# Save test results | ||
- store_test_results: | ||
path: /tmp/circleci-test-results | ||
# Save artifacts | ||
- store_artifacts: | ||
path: /tmp/circleci-artifacts | ||
- store_artifacts: | ||
path: /tmp/circleci-test-results | ||
deploy: | ||
docker: | ||
- image: buildpack-deps:trusty | ||
steps: | ||
- checkout | ||
- run: | ||
name: Deploy Master to Heroku | ||
command: git push https://heroku:[email protected]/$HEROKU_APP_NAME.git master | ||
|
||
workflows: | ||
version: 2 | ||
test-and-deploy: | ||
jobs: | ||
- test | ||
- deploy: | ||
filters: | ||
branches: | ||
only: master | ||
requires: | ||
- test |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
test: | ||
database: circle_ruby_test | ||
adapter: postgresql | ||
url: <%= ENV["DATABASE_URL"] %> | ||
username: ubuntu | ||
host: localhost |