Created
February 7, 2019 10:16
-
-
Save pooza/821b799e3d48e9fb5bfb399efbe4eb6a to your computer and use it in GitHub Desktop.
.circleci/config.yml
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
version: 2 | |
jobs: | |
build: | |
docker: | |
- image: circleci/ruby:2.5.3-node-browsers | |
working_directory: ~/repos | |
steps: | |
- checkout | |
- run: | |
name: install bundler | |
command: gem install bundler -v '<2' | |
- run: | |
name: install dependencies | |
command: bundle install | |
- run: | |
name: run RuboCop | |
command: bundle exec rubocop | |
- run: | |
name: update repository | |
command: bundle exec rake repos:update | |
- run: | |
name: check repository | |
command: bundle exec rake repos:check |
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
dir = File.expand_path(__dir__) | |
namespace :cert do | |
desc 'update cert' | |
task :update do | |
require 'httparty' | |
File.write( | |
File.join(dir, 'cert/cacert.pem'), | |
HTTParty.get('https://curl.haxx.se/ca/cacert.pem'), | |
) | |
end | |
desc 'check cert' | |
task :check do | |
if `git status`.include?('cacert.pem') | |
STDERR.puts 'cert is not fresh.' | |
exit 1 | |
end | |
end | |
end | |
namespace :bundle do | |
desc 'update gems' | |
task :update do | |
sh 'bundle update' | |
end | |
desc 'check gems' | |
task :check do | |
if `git status`.include?('Gemfile.lock') | |
STDERR.puts 'gems is not fresh.' | |
exit 1 | |
end | |
end | |
end | |
namespace :repos do | |
desc 'update cert/gems' | |
task update: ['cert:update', 'bundle:update'] | |
desc 'check cert/gems' | |
task check: ['cert:check', 'bundle:check'] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment