yes_ship_it 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/ruby.yml +23 -0
- data/.ruby-version +1 -0
- data/assertions/release_branch.rb +2 -4
- data/lib/version.rb +1 -1
- data/spec/integration/cli_spec.rb +2 -2
- data/spec/spec_helper.rb +4 -0
- data/spec/system/dry_run_spec.rb +1 -1
- data/spec/system/rpm_spec.rb +1 -1
- data/spec/system/ruby_gem_spec.rb +4 -4
- data/spec/unit/assertion_spec.rb +14 -12
- data/spec/unit/assertions/release_branch_spec.rb +17 -3
- data/spec/unit/assertions/yes_it_shipped_spec.rb +5 -4
- data/spec/unit/executor_spec.rb +1 -1
- data/yes_ship_it.gemspec +1 -0
- metadata +19 -5
- data/.travis.yml +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: be8b01a1d9a12d083bd94de3b302a6f2a21fb67747ee79913b435dafb32f47e1
|
4
|
+
data.tar.gz: d55a649008a05966837fc3d7d070ac7fec0fa631615711b53fed0c97b3b8d789
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5dd3d86ef3169db543b724088af7ec2e9cf804737dc858cfac3c30eb50b8264ddd48eb166f641b49cce62db56f62068db82da676c6f0b306d74b0913c3cb8fc0
|
7
|
+
data.tar.gz: 860e1901d6fbc0c47dd79c4c2cee50cadff9834c6fef7afe5985455de99213cac38aa0105ad8b909a985f8eae2b0d5eb0989ad9930d17c94afee412980dda4e0
|
@@ -0,0 +1,23 @@
|
|
1
|
+
name: Ruby CI
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
|
10
|
+
strategy:
|
11
|
+
matrix:
|
12
|
+
ruby-version: [3.0.1, 2.7.3, 2.6.7]
|
13
|
+
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v2
|
16
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
17
|
+
uses: ruby/setup-ruby@v1
|
18
|
+
with:
|
19
|
+
ruby-version: ${{ matrix.ruby-version }}
|
20
|
+
- name: Install dependencies
|
21
|
+
run: bundle install
|
22
|
+
- name: Run tests
|
23
|
+
run: bundle exec rspec spec/unit
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.7.3
|
data/lib/version.rb
CHANGED
@@ -407,7 +407,7 @@ EOT
|
|
407
407
|
end
|
408
408
|
end
|
409
409
|
|
410
|
-
plugin_path = File.join(dir, "yes_ship_it", "assertions", "my_plugin.rb")
|
410
|
+
plugin_path = File.join(path_prefix, dir, "yes_ship_it", "assertions", "my_plugin.rb")
|
411
411
|
|
412
412
|
expected_output = <<EOT
|
413
413
|
Can't generate plugin. Plugin already exists at `#{plugin_path}`.
|
@@ -418,7 +418,7 @@ EOT
|
|
418
418
|
|
419
419
|
it "creates new plugin" do
|
420
420
|
dir = given_directory
|
421
|
-
plugin_path = File.join(dir, "yes_ship_it", "assertions", "my_plugin.rb")
|
421
|
+
plugin_path = File.join(path_prefix, dir, "yes_ship_it", "assertions", "my_plugin.rb")
|
422
422
|
|
423
423
|
expected_output = <<EOT
|
424
424
|
Generated assertion plugin at `#{plugin_path}`.
|
data/spec/spec_helper.rb
CHANGED
data/spec/system/dry_run_spec.rb
CHANGED
@@ -29,7 +29,7 @@ describe "dry run" do
|
|
29
29
|
checkout_tar = File.expand_path("../data/red_herring-checkout-dry-run.tar.gz", __FILE__)
|
30
30
|
@client.inject_tarball(checkout_tar)
|
31
31
|
|
32
|
-
@client.execute(["yes_ship_it.ruby2.
|
32
|
+
@client.execute(["yes_ship_it.ruby2.5", "--dry-run"], working_directory: "red_herring")
|
33
33
|
|
34
34
|
expected_output = <<EOT
|
35
35
|
Shipping...
|
data/spec/system/rpm_spec.rb
CHANGED
@@ -29,7 +29,7 @@ describe "rpm" do
|
|
29
29
|
checkout_tar = File.expand_path("../data/red_herring-checkout-rpm.tar.gz", __FILE__)
|
30
30
|
@client.inject_tarball(checkout_tar)
|
31
31
|
|
32
|
-
@client.execute(["yes_ship_it.ruby2.
|
32
|
+
@client.execute(["yes_ship_it.ruby2.5"], working_directory: "red_herring")
|
33
33
|
|
34
34
|
expected_output = <<EOT
|
35
35
|
Shipping...
|
@@ -30,7 +30,7 @@ describe "ship ruby gem" do
|
|
30
30
|
checkout_tar = File.expand_path("../data/red_herring-checkout-build.tar.gz", __FILE__)
|
31
31
|
@client.inject_tarball(checkout_tar)
|
32
32
|
|
33
|
-
@client.execute(["yes_ship_it.ruby2.
|
33
|
+
@client.execute(["yes_ship_it.ruby2.5"], working_directory: "red_herring")
|
34
34
|
|
35
35
|
expect(@client.exit_code).to eq(0)
|
36
36
|
|
@@ -55,7 +55,7 @@ EOT
|
|
55
55
|
checkout_tar = File.expand_path("../data/red_herring-checkout-push.tar.gz", __FILE__)
|
56
56
|
@client.inject_tarball(checkout_tar)
|
57
57
|
|
58
|
-
@client.execute(["yes_ship_it.ruby2.
|
58
|
+
@client.execute(["yes_ship_it.ruby2.5"], working_directory: "red_herring")
|
59
59
|
|
60
60
|
expect(@client.exit_code).to eq(0)
|
61
61
|
|
@@ -83,7 +83,7 @@ EOT
|
|
83
83
|
checkout_tar = File.expand_path("../data/red_herring-checkout-not-push.tar.gz", __FILE__)
|
84
84
|
@client.inject_tarball(checkout_tar)
|
85
85
|
|
86
|
-
@client.execute(["yes_ship_it.ruby2.
|
86
|
+
@client.execute(["yes_ship_it.ruby2.5"], working_directory: "red_herring")
|
87
87
|
|
88
88
|
expect(@client.exit_code).to eq(0)
|
89
89
|
|
@@ -115,7 +115,7 @@ EOT
|
|
115
115
|
end
|
116
116
|
|
117
117
|
it "tells how to login" do
|
118
|
-
@client.execute(["yes_ship_it.ruby2.
|
118
|
+
@client.execute(["yes_ship_it.ruby2.5"], working_directory: "red_herring")
|
119
119
|
|
120
120
|
expected_output = <<EOT
|
121
121
|
Shipping...
|
data/spec/unit/assertion_spec.rb
CHANGED
@@ -24,34 +24,36 @@ describe YSI::Assertion do
|
|
24
24
|
end
|
25
25
|
|
26
26
|
describe "parameters" do
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
module YSI
|
28
|
+
class MyAssertion < Assertion
|
29
|
+
parameter :some_thing
|
30
|
+
parameter :some_other_thing, "default_hello"
|
30
31
|
|
31
|
-
|
32
|
-
|
33
|
-
|
32
|
+
def self.display_name
|
33
|
+
"My Assertion"
|
34
|
+
end
|
34
35
|
|
35
|
-
|
36
|
-
|
36
|
+
def check
|
37
|
+
end
|
37
38
|
|
38
|
-
|
39
|
+
def assert
|
40
|
+
end
|
39
41
|
end
|
40
42
|
end
|
41
43
|
|
42
44
|
it "has methods for parameter" do
|
43
|
-
my = MyAssertion.new(YSI::Engine.new)
|
45
|
+
my = YSI::MyAssertion.new(YSI::Engine.new)
|
44
46
|
my.some_thing = "hello"
|
45
47
|
expect(my.some_thing).to eq("hello")
|
46
48
|
end
|
47
49
|
|
48
50
|
it "has default value for parameter" do
|
49
|
-
my = MyAssertion.new(YSI::Engine.new)
|
51
|
+
my = YSI::MyAssertion.new(YSI::Engine.new)
|
50
52
|
expect(my.some_other_thing).to eq("default_hello")
|
51
53
|
end
|
52
54
|
|
53
55
|
it "returns nil when parameter is not set" do
|
54
|
-
my = MyAssertion.new(YSI::Engine.new)
|
56
|
+
my = YSI::MyAssertion.new(YSI::Engine.new)
|
55
57
|
expect(my.some_thing).to be(nil)
|
56
58
|
end
|
57
59
|
|
@@ -2,7 +2,7 @@ require_relative "../spec_helper.rb"
|
|
2
2
|
|
3
3
|
describe YSI::ReleaseBranch do
|
4
4
|
describe "#current_branch" do
|
5
|
-
it "finds current non-
|
5
|
+
it "finds current non-release branch" do
|
6
6
|
a = YSI::ReleaseBranch.new(YSI::Engine)
|
7
7
|
|
8
8
|
allow(a).to receive(:git_branch).and_return(" master\n* otherone\n")
|
@@ -10,7 +10,7 @@ describe YSI::ReleaseBranch do
|
|
10
10
|
expect(a.current_branch).to eq("otherone")
|
11
11
|
end
|
12
12
|
|
13
|
-
it "finds current
|
13
|
+
it "finds current release branch" do
|
14
14
|
a = YSI::ReleaseBranch.new(YSI::Engine)
|
15
15
|
|
16
16
|
allow(a).to receive(:git_branch).and_return("* master\n otherone\n")
|
@@ -18,12 +18,26 @@ describe YSI::ReleaseBranch do
|
|
18
18
|
expect(a.current_branch).to eq("master")
|
19
19
|
end
|
20
20
|
|
21
|
-
it "finds current
|
21
|
+
it "finds current release branch if it's the only branch" do
|
22
22
|
a = YSI::ReleaseBranch.new(YSI::Engine)
|
23
23
|
|
24
24
|
allow(a).to receive(:git_branch).and_return("* master\n")
|
25
25
|
|
26
26
|
expect(a.current_branch).to eq("master")
|
27
27
|
end
|
28
|
+
|
29
|
+
it "reads branch parameter" do
|
30
|
+
config = <<~YAML
|
31
|
+
assertions:
|
32
|
+
release_branch:
|
33
|
+
branch: main
|
34
|
+
version:
|
35
|
+
version_file: lib/version.rb
|
36
|
+
YAML
|
37
|
+
engine = YSI::Engine.new
|
38
|
+
engine.read_config(config)
|
39
|
+
|
40
|
+
expect(engine.assertions.first.branch).to eq("main")
|
41
|
+
end
|
28
42
|
end
|
29
43
|
end
|
@@ -17,7 +17,7 @@ describe YSI::YesItShipped do
|
|
17
17
|
}
|
18
18
|
EOT
|
19
19
|
stub_request(:get, "https://yes-it-shipped.herokuapp.com/releases/dummy/1.0.0").
|
20
|
-
|
20
|
+
with(:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>/.*/, 'Host'=>'yes-it-shipped.herokuapp.com', 'User-Agent'=>/.*/}).
|
21
21
|
to_return(:status => 200, :body => body, :headers => {})
|
22
22
|
|
23
23
|
engine = YSI::Engine.new
|
@@ -29,7 +29,7 @@ EOT
|
|
29
29
|
|
30
30
|
it "fails when release is not there" do
|
31
31
|
stub_request(:get, "https://yes-it-shipped.herokuapp.com/releases/dummy/2.0.0").
|
32
|
-
|
32
|
+
with(:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>/.*/, 'Host'=>'yes-it-shipped.herokuapp.com', 'User-Agent'=>/.*/}).
|
33
33
|
to_return(:status => 404, :body => "", :headers => {})
|
34
34
|
|
35
35
|
engine = YSI::Engine.new
|
@@ -54,10 +54,11 @@ EOT
|
|
54
54
|
},
|
55
55
|
:headers => {
|
56
56
|
'Accept'=>'*/*',
|
57
|
-
'Accept-Encoding'=>
|
57
|
+
'Accept-Encoding'=> /.*/,
|
58
58
|
'Content-Length'=>'334',
|
59
59
|
'Content-Type'=>'application/x-www-form-urlencoded',
|
60
|
-
'Host'=>'yes-it-shipped.herokuapp.com'
|
60
|
+
'Host'=>'yes-it-shipped.herokuapp.com',
|
61
|
+
'User-Agent' => /.*/
|
61
62
|
}).to_return(:status => 200, :body => "", :headers => {})
|
62
63
|
|
63
64
|
engine = YSI::Engine.new
|
data/spec/unit/executor_spec.rb
CHANGED
@@ -6,7 +6,7 @@ describe YSI::Executor do
|
|
6
6
|
describe "working directory" do
|
7
7
|
it "runs in the given working directory" do
|
8
8
|
working_directory = subject.run_command(["pwd"], working_directory: "/tmp")
|
9
|
-
expect(working_directory).to eq("/tmp\n")
|
9
|
+
expect(working_directory).to eq(File.join(path_prefix, "/tmp\n"))
|
10
10
|
end
|
11
11
|
|
12
12
|
it "sets back the working directory to the original value" do
|
data/yes_ship_it.gemspec
CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.add_development_dependency "cli_tester", ">= 0.0.2"
|
25
25
|
s.add_development_dependency "httpotemkin"
|
26
26
|
s.add_development_dependency "webmock", "~> 2.1"
|
27
|
+
s.add_development_dependency "byebug"
|
27
28
|
|
28
29
|
s.files = `git ls-files`.split("\n")
|
29
30
|
s.require_path = 'lib'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yes_ship_it
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cornelius Schumacher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inifile
|
@@ -122,6 +122,20 @@ dependencies:
|
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '2.1'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: byebug
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
125
139
|
description: Whenever the answer is 'Yes, ship it!' you will need yes_ship_it. It
|
126
140
|
is the ultimate helper in releasing software..
|
127
141
|
email:
|
@@ -132,9 +146,10 @@ extensions: []
|
|
132
146
|
extra_rdoc_files: []
|
133
147
|
files:
|
134
148
|
- ".codeclimate.yml"
|
149
|
+
- ".github/workflows/ruby.yml"
|
135
150
|
- ".gitignore"
|
136
151
|
- ".rspec"
|
137
|
-
- ".
|
152
|
+
- ".ruby-version"
|
138
153
|
- CHANGELOG.md
|
139
154
|
- Gemfile
|
140
155
|
- MIT-LICENSE
|
@@ -242,8 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
242
257
|
- !ruby/object:Gem::Version
|
243
258
|
version: 1.3.6
|
244
259
|
requirements: []
|
245
|
-
|
246
|
-
rubygems_version: 2.5.1
|
260
|
+
rubygems_version: 3.1.6
|
247
261
|
signing_key:
|
248
262
|
specification_version: 4
|
249
263
|
summary: The ultimate release script
|