singularity_dsl 1.2.5 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/Gemfile.lock +1 -1
- data/lib/singularity_dsl/cli/cli.rb +18 -10
- data/lib/singularity_dsl/git_helper.rb +4 -0
- data/lib/singularity_dsl/stdout.rb +5 -0
- data/lib/singularity_dsl/version.rb +1 -1
- data/spec/singularity_dsl/cli/cli_spec.rb +27 -0
- data/spec/singularity_dsl/tasks/shell_task_spec.rb +3 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Mzg2MGViZWNiZjM3MWYwNWYzMTlmYTk2ZDQxYTcxZmI0NzQxZTNjMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Zjk3MTE3OTk4NjI3ZGNmMzM3ZDRhMDdmZjc1NGNiOTY4ODBiY2YyNQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGE5ZjUwZDkwZWY1ZmI4ZjUzNDkyODQ1NmY5ZGVkYmNhOGQ2YTFiYzdkNzA0
|
10
|
+
MWQ4ODc0MzYxMmZlYTMyNzY0ZWFmNjhhM2ZlOTBjNmE0NzBlZjU0M2EyYzll
|
11
|
+
NDYxZGQ0MDAxZGJmNjkwYzJkZTRlMWMyN2JlMzNhMTQ1NzIyYWM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
N2MxM2M2ZGMxMjgxMGQ5MzZmOTlmOTU1MDQyOWYzNjYwYzM4YWMzNDllMDU3
|
14
|
+
YjNmNWFiMmE3NjVlYzMxM2EzM2E0MWRhMGI0MDU5ODg0Mzg0MjQ2OTBmNjI4
|
15
|
+
Njc3ODliODAwZDdmMWMzZTQ4OTVkNzkyY2QwMTEzMzhlMzdiMDM=
|
data/Gemfile.lock
CHANGED
@@ -58,7 +58,8 @@ module SingularityDsl
|
|
58
58
|
end
|
59
59
|
|
60
60
|
# BATCH COMMAND
|
61
|
-
desc 'batch BATCH_NAME',
|
61
|
+
desc 'batch BATCH_NAME',
|
62
|
+
'Run single task batch in the .singularityrc script.'
|
62
63
|
def batch(batch, app = nil)
|
63
64
|
app ||= setup_app(Application.new, singularity_script, tasks_path)
|
64
65
|
exit(app.run batch, options[:all_tasks])
|
@@ -66,30 +67,37 @@ module SingularityDsl
|
|
66
67
|
|
67
68
|
# TEST-MERGE COMMAND
|
68
69
|
desc 'testmerge FORK BRANCH INTO_BRANCH [INTO_FORK]',
|
69
|
-
'Perform a
|
70
|
+
'Perform a testmerge into the local repo and then run .singularityrc'
|
70
71
|
option :run_task,
|
71
72
|
aliases: '-r',
|
72
73
|
type: :string,
|
73
|
-
desc: 'Run a batch
|
74
|
+
desc: 'Run a batch instead, after testmerge.',
|
74
75
|
default: ''
|
75
76
|
def testmerge(git_fork, branch, base_branch, base_fork = nil)
|
76
77
|
test_merge git_fork, branch, base_branch, base_fork
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
@git.remove_remote base_fork
|
82
|
-
batch target_run_task if options[:run_task]
|
78
|
+
@diff_list = diff_list base_branch, base_fork
|
79
|
+
remove_remotes git_fork, base_fork
|
80
|
+
batch target_run_task if target_run_task
|
81
|
+
test unless target_run_task
|
83
82
|
end
|
84
83
|
|
85
84
|
private
|
86
85
|
|
86
|
+
def diff_list(ref, url)
|
87
|
+
@git.diff_remote ref, url, '--name-only'
|
88
|
+
end
|
89
|
+
|
90
|
+
def remove_remotes(*urls)
|
91
|
+
urls.each { |url| @git.remove_remote url }
|
92
|
+
end
|
93
|
+
|
87
94
|
def test_merge(git_fork, branch, base_branch, base_fork)
|
88
95
|
@git.clean_reset
|
89
96
|
@git.add_remote base_fork
|
90
97
|
@git.checkout_remote base_branch, base_fork
|
91
98
|
@git.add_remote git_fork
|
92
99
|
@git.merge_remote branch, git_fork
|
100
|
+
@git.install_submodules
|
93
101
|
end
|
94
102
|
|
95
103
|
def target_run_task
|
@@ -105,7 +113,7 @@ module SingularityDsl
|
|
105
113
|
end
|
106
114
|
unless @diff_list.nil?
|
107
115
|
info 'Running with diff-list'
|
108
|
-
|
116
|
+
list_items @diff_list
|
109
117
|
app.change_list @diff_list
|
110
118
|
end
|
111
119
|
info "Loading CI script from #{singularity_script} ..."
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'singularity_dsl/cli/cli'
|
4
|
+
|
5
|
+
describe 'Cli' do
|
6
|
+
let(:cli) { SingularityDsl::Cli::Cli.new }
|
7
|
+
|
8
|
+
context '#testmerge' do
|
9
|
+
before(:each) do
|
10
|
+
expect(cli).to receive(:test_merge)
|
11
|
+
expect(cli).to receive(:diff_list)
|
12
|
+
expect(cli).to receive(:remove_remotes)
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'runs test method if no run_task' do
|
16
|
+
cli.stub(:target_run_task).and_return false
|
17
|
+
expect(cli).to receive(:test)
|
18
|
+
cli.testmerge 'fork', 'fork_branch', 'base_branch'
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'runs batch method if no run_task' do
|
22
|
+
cli.stub(:target_run_task).and_return 'test_batch'
|
23
|
+
expect(cli).to receive(:batch)
|
24
|
+
cli.testmerge 'fork', 'fork_branch', 'base_branch'
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: singularity_dsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- chr0n1x
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-shellout
|
@@ -179,6 +179,7 @@ files:
|
|
179
179
|
- lib/singularity_dsl/version.rb
|
180
180
|
- singularity_dsl.gemspec
|
181
181
|
- spec/singularity_dsl/application_spec.rb
|
182
|
+
- spec/singularity_dsl/cli/cli_spec.rb
|
182
183
|
- spec/singularity_dsl/dsl/batch_spec.rb
|
183
184
|
- spec/singularity_dsl/dsl/changeset_spec.rb
|
184
185
|
- spec/singularity_dsl/dsl/dsl_spec.rb
|
@@ -217,6 +218,7 @@ specification_version: 4
|
|
217
218
|
summary: ''
|
218
219
|
test_files:
|
219
220
|
- spec/singularity_dsl/application_spec.rb
|
221
|
+
- spec/singularity_dsl/cli/cli_spec.rb
|
220
222
|
- spec/singularity_dsl/dsl/batch_spec.rb
|
221
223
|
- spec/singularity_dsl/dsl/changeset_spec.rb
|
222
224
|
- spec/singularity_dsl/dsl/dsl_spec.rb
|