Navigation Menu

Skip to content

Commit

Permalink
Fix CI environment
Browse files Browse the repository at this point in the history
  • Loading branch information
dazuma committed Jun 17, 2019
1 parent 0949b18 commit cd6635e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Expand Up @@ -8,7 +8,7 @@ jobs:
- checkout
- run:
name: CI on Ruby 2.3
command: ./toys-dev ci
command: ./toys-dev do ci init , ci
Test Ruby 2.4:
docker:
- image: circleci/ruby:2.4-stretch
Expand All @@ -17,7 +17,7 @@ jobs:
- checkout
- run:
name: CI on Ruby 2.4
command: ./toys-dev ci
command: ./toys-dev do ci init , ci
Test Ruby 2.5:
docker:
- image: circleci/ruby:2.5-stretch
Expand All @@ -26,7 +26,7 @@ jobs:
- checkout
- run:
name: CI on Ruby 2.5
command: ./toys-dev ci
command: ./toys-dev do ci init , ci
Test Ruby 2.6:
docker:
- image: circleci/ruby:2.6-stretch
Expand All @@ -35,7 +35,7 @@ jobs:
- checkout
- run:
name: CI on Ruby 2.6
command: ./toys-dev ci
command: ./toys-dev do ci init , ci
workflows:
version: 2
tests:
Expand Down
26 changes: 26 additions & 0 deletions .toys.rb
Expand Up @@ -88,6 +88,32 @@ def run
handle_gem("toys-core")
handle_gem("toys")
end

tool "init" do
desc "Initialize the environment for CI systems"

include :exec
include :terminal

def run
changed = false
if exec(["git", "config", "--global", "--get", "user.email"], out: :null).error?
exec(["git", "config", "--global", "user.email", "hello@example.com"],
exit_on_nonzero_status: true)
changed = true
end
if exec(["git", "config", "--global", "--get", "user.name"], out: :null).error?
exec(["git", "config", "--global", "user.name", "Hello Ruby"],
exit_on_nonzero_status: true)
changed = true
end
if changed
puts("**** Environment is now set up for CI", :bold, :green)
else
puts("**** Environment was already set up for CI", :bold, :yellow)
end
end
end
end

tool "yardoc" do
Expand Down

0 comments on commit cd6635e

Please sign in to comment.