circleci-ruby-orbs
circleci-ruby-orbs copied to clipboard
CircleCI orb for ruby
circleci-ruby-orbs
CircleCI orb for ruby
https://circleci.com/orbs/registry/orb/sue445/ruby-orbs
Requirements
- Ruby and bundler
- recommend circleci/ruby
Usage
Common setting
# .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
bundle-install
Run bundle install using cache.
for app repo (Gemfile.lock is committed)
# .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
for gem repo (Gemfile.lock is not committed)
# .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
Parameters
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 --pathor usebundle config set path(default:vendor/bundle)bundle_gemfile: Passed tobundle install --gemfile(default:Gemfile)bundle_clean: Whether pass--cleantobundle installor usebundle config set --local clean 'true'(default:true)bundle_deployment: Whether path to--deploymentor runbundle config set deployment 'true'(default:false)bundle_frozen: Whether path to--frozenor runbundle config set frozen 'true'(default:false)bundle_no_cache: Whether path to--no-cacheor runbundle config set no-cache 'true'(default:false)bundle_no_prune: Whether path to--no-pruneor runbundle config set no-prune 'true'(default:false)bundle_shebang: Whether path to--shebangor runbundle config set shebang 'true'(default:false)bundle_system: Whether path to--systemor runbundle config set system 'true'(default:false)bundle_without: Passed tobundle install --withoutorbundle config set withoutbundle_with: Passed tobundle install --withorbundle config set withbundle_extra_args: Arguments to pass tobundle installrestore_bundled_with: Whether resolve bundler version difference betweenGemfile.lockand pre-installed in CI (default:true)with_gemfile_lock: Whether usingGemfile.lockfor cache key (default:true)gemspec_name: gemspec name (required ifwith_gemfile_lockis false)update_always: Whether run alwaysbundle updatewhenwith_gemfile_lockis disabled (default:false)
bundle-update-pr
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
Parameters
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)
External
- Smoke test repository for circleci-ruby-orbs
- https://github.com/sue445/circleci-ruby-orbs-test