Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] fan in out with 2.1 features #35

Open
wants to merge 5 commits into
base: fan-in-fan-out
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 20 additions & 55 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,32 @@
version: 2.0
version: 2.1

jobs:
checkout_code:
checkout_and_bundle_dependencies:
docker:
- image: circleci/ruby:2.4-node
- image: circleci/postgres:9.4.12-alpine
working_directory: ~/circleci-demo-workflows
steps:
- checkout
- save_cache:
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
paths:
- ~/circleci-demo-workflows

bundle_dependencies:
docker:
- image: circleci/ruby:2.4-node
- image: circleci/postgres:9.4.12-alpine
working_directory: ~/circleci-demo-workflows
steps:
- restore_cache:
keys:
- v1-repo-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- v1-bundle-{{ checksum "Gemfile.lock" }}
key: v1-bundle-{{ checksum "Gemfile.lock" }}
- run: bundle install --path vendor/bundle
- save_cache:
key: v1-bundle-{{ checksum "Gemfile.lock" }}
paths:
- ~/circleci-demo-workflows/vendor/bundle
- persist_to_workspace:
root: .
paths:
- .

rake_test:
docker:
- image: circleci/ruby:2.4-node
- image: circleci/postgres:9.4.12-alpine
working_directory: ~/circleci-demo-workflows
steps:
- restore_cache:
keys:
- v1-repo-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- v1-bundle-{{ checksum "Gemfile.lock" }}
- run: bundle --path vendor/bundle
- attach_workspace:
at: .
- run: bundle exec rake db:create db:schema:load
- run:
name: Run tests
Expand All @@ -52,60 +35,42 @@ jobs:
precompile_assets:
docker:
- image: circleci/ruby:2.4-node
- image: circleci/postgres:9.4.12-alpine
working_directory: ~/circleci-demo-workflows
steps:
- restore_cache:
keys:
- v1-repo-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- v1-bundle-{{ checksum "Gemfile.lock" }}
- run: bundle --path vendor/bundle
- attach_workspace:
at: .
- run:
name: Precompile assets
command: bundle exec rake assets:precompile
- save_cache:
key: v1-assets-{{ .Environment.CIRCLE_SHA1 }}
- persist_to_workspace:
root: .
paths:
- ~/circleci-demo-workflows/public/assets
- public/assets

deploy:
machine:
enabled: true
working_directory: ~/circleci-demo-workflows
environment:
- HEROKU_APP: still-shelf-38337
HEROKU_APP: still-shelf-38337
steps:
- restore_cache:
keys:
- v1-repo-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache:
keys:
- v1-bundle-{{ checksum "Gemfile.lock" }}
- restore_cache:
keys:
- v1-assets-{{ .Environment.CIRCLE_SHA1 }}
- checkout
- attach_workspace:
at: .
- run:
name: Deploy Master to Heroku
command: |
git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP.git master

workflows:
version: 2
build-and-deploy:
jobs:
- checkout_code
- bundle_dependencies:
requires:
- checkout_code
- checkout_and_bundle_dependencies
- rake_test:
requires:
- bundle_dependencies
- checkout_and_bundle_dependencies
- precompile_assets:
requires:
- bundle_dependencies
- checkout_and_bundle_dependencies
- deploy:
requires:
- rake_test
Expand Down