-
Notifications
You must be signed in to change notification settings - Fork 1
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
836d89d
commit 5ee8e1e
Showing
1 changed file
with
49 additions
and
7 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 |
---|---|---|
@@ -1,26 +1,68 @@ | ||
# Use the latest 2.1 version of CircleCI pipeline process engine. | ||
# See: https://circleci.com/docs/2.0/configuration-reference | ||
version: 2.1 | ||
|
||
orbs: | ||
ruby: circleci/[email protected] | ||
node: circleci/node@2 | ||
# Define a job to be invoked later in a workflow. | ||
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs | ||
jobs: | ||
say-hello: | ||
build: | ||
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub. | ||
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor | ||
docker: | ||
- image: cimg/base:stable | ||
- image: cimg/ruby:2.7.2-node | ||
auth: | ||
username: mydockerhub-user | ||
password: $DOCKERHUB_PASSWORD | ||
# Add steps to the job | ||
# See: https://circleci.com/docs/2.0/configuration-reference/#steps | ||
steps: | ||
- checkout | ||
- ruby/install-deps | ||
|
||
test: | ||
parallelism: 3 | ||
docker: | ||
- image: cimg/ruby:2.7.2-node | ||
auth: | ||
username: mydockerhub-user | ||
password: $DOCKERHUB_PASSWORD | ||
- image: circleci/postgres:9.5-alpine | ||
auth: | ||
username: mydockerhub-user | ||
password: $DOCKERHUB_PASSWORD | ||
environment: | ||
POSTGRES_USER: circleci-demo-ruby | ||
POSTGRES_DB: rails_blog_test | ||
POSTGRES_PASSWORD: "" | ||
environment: | ||
BUNDLE_JOBS: "3" | ||
BUNGLE_RETRY: "3" | ||
PGHOST: 127.0.0.1 | ||
PGUSER: circleci-demo-ruby | ||
PGPASSWORD: "" | ||
RAILS_ENV: test | ||
|
||
steps: | ||
- checkout | ||
- ruby/install-deps | ||
- run: | ||
name: wait for db | ||
command: dockerize -wait tcp://localhost:5432 -timeout 1m | ||
- run: | ||
name: database setup | ||
command: bundle exec rake db:{create,migrate} | ||
- run: | ||
name: "Say hello" | ||
command: "echo Hello, World!" | ||
name: run tests | ||
command: bundle exec rspec | ||
|
||
# Invoke jobs via workflows | ||
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows | ||
workflows: | ||
say-hello-workflow: | ||
build-and-test: | ||
jobs: | ||
- say-hello | ||
- build | ||
- test: | ||
requires: | ||
- build |