CircleCI orb for ruby
https://circleci.com/orbs/registry/orb/sue445/ruby-orbs
- Ruby and bundler
- recommend circleci/ruby
# .circleci/config.yml
version: 2.1
orbs:
# Use specific version
# see. https://github.com/sue445/circleci-ruby-orbs/releases
ruby-orbs: sue445/[email protected]
# or
# Use latest version
# ruby-orbs: sue445/ruby-orbs@volatile
Run bundle install
using cache.
# .circleci/config.yml
jobs:
rspec:
docker:
- image: circleci/ruby
steps:
- checkout
- ruby-orbs/bundle-install
# or
- ruby-orbs/bundle-install:
cache_key_prefix: "v1-bundle"
bundle_jobs: 4
bundle_retry: 3
bundle_path: "vendor/bundle"
bundle_gemfile: "Gemfile"
bundle_clean: true
bundle_extra_args: ""
restore_bundled_with: true
# Add your job (e.g. rspec, rubocop)
- run: bundle exec rspec
# .circleci/config.yml
jobs:
rspec:
docker:
- image: circleci/ruby
steps:
- checkout
- ruby-orbs/bundle-install:
with_gemfile_lock: false
gemspec_name: "yourgem"
# or
- ruby-orbs/bundle-install:
with_gemfile_lock: false
gemspec_name: "yourgem"
cache_key_prefix: "v1-bundle"
bundle_jobs: 4
bundle_retry: 3
bundle_path: "vendor/bundle"
bundle_clean: true
bundle_extra_args: ""
update_always: false
# Add your job (e.g. rspec, rubocop)
- run: bundle exec rspec
cache_key_prefix
: Key prefix of cache (default:v1-bundle
)bundle_jobs
: Passed tobundle install --jobs
(default:4
)bundle_retry
: Passed tobundle install --retry
(default:3
)bundle_path
: Passed tobundle install --path
or usebundle config set path
(default:vendor/bundle
)bundle_gemfile
: Passed tobundle install --gemfile
(default:Gemfile
)bundle_clean
: Whether pass--clean
tobundle install
or usebundle config set --local clean 'true'
(default:true
)bundle_deployment
: Whether path to--deployment
or runbundle config set deployment 'true'
(default:false
)bundle_frozen
: Whether path to--frozen
or runbundle config set frozen 'true'
(default:false
)bundle_no_cache
: Whether path to--no-cache
or runbundle config set no-cache 'true'
(default:false
)bundle_no_prune
: Whether path to--no-prune
or runbundle config set no-prune 'true'
(default:false
)bundle_shebang
: Whether path to--shebang
or runbundle config set shebang 'true'
(default:false
)bundle_system
: Whether path to--system
or runbundle config set system 'true'
(default:false
)bundle_without
: Passed tobundle install --without
orbundle config set without
bundle_with
: Passed tobundle install --with
orbundle config set with
bundle_extra_args
: Arguments to pass tobundle install
restore_bundled_with
: Whether resolve bundler version difference betweenGemfile.lock
and pre-installed in CI (default:true
)with_gemfile_lock
: Whether usingGemfile.lock
for cache key (default:true
)gemspec_name
: gemspec name (required ifwith_gemfile_lock
is false)update_always
: Whether run alwaysbundle update
whenwith_gemfile_lock
is disabled (default:false
)
Run bundle update
and send PullRequest.
Uses https://github.com/masutaka/circleci-bundle-update-pr
workflows:
version: 2
nightly:
triggers:
- schedule:
cron: "00 10 * * 5"
filters:
branches:
only: master
jobs:
- ruby-orbs/bundle-update-pr
# or
- ruby-orbs/bundle-update-pr:
image: "circleci/ruby:2.5.3"
pre-bundle-update-pr:
- run:
name: "Set timezone to Asia/Tokyo"
command: "sudo cp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime"
- ruby-orbs/bundle-install
git_user_name: "yourname"
git_user_email: "[email protected]"
github_access_token: GITHUB_ACCESS_TOKEN
image
: Image forbundle update
(default:circleci/ruby
)pre-bundle-update-pr
: Run steps beforecircleci-bundle-update-pr
(default:[]
)post-bundle-update-pr
: Run steps aftercircleci-bundle-update-pr
(default:[]
)version
: circleci-bundle-update-pr vesion. default is latestassignees
: Assign the PR to them. (e.g. alice,bob,carol)reviewers
: Request PR review to them. (e.g. alice,bob,carol)labels
: Add labels to the PR (e.g. In Review, Update)duplicate
: Make PR even if it has already existed (default:false
)git_user_name
: Username for commit (default:$GIT_USER_NAME
)git_user_email
: E-mail for commit (default:$GIT_USER_EMAIL
)branch
: Space separated branches. (e.g.master develop topic
) (default:$CIRCLE_BRANCH
)github_access_token
: Your GitHub personal access token as an env var on CircleCI (default:GITHUB_ACCESS_TOKEN
)- Go to your account's settings page and generate a personal access token with "repo" scope
- Use the CircleCI UI to set the GITHUB_ACCESS_TOKEN environment variable.
enterprise_octokit_access_token
: Your GitHub Enterprise personal access token as an env var on CircleCI (default.ENTERPRISE_OCTOKIT_ACCESS_TOKEN
)- Use the CircleCI UI to set the ENTERPRISE_OCTOKIT_ACCESS_TOKEN environment variable.
enterprise_octokit_api_endpoint
: Your GitHub Enterprise api endpoint (e.g. https://www.example.com/api/v3) (default:$ENTERPRISE_OCTOKIT_API_ENDPOINT
)no_output_timeout
: Elapsed time the command can run without output. (e.g. 20m, 1.25h, 5s) (default:10m
)
- Smoke test repository for circleci-ruby-orbs