singularity_dsl 1.3.2 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTEyZDNjOTA1YTJiY2E4ZjZlYmZlMjMyZWMxNjI3YTlhNTNkNzZiNw==
4
+ NjY4YmE3ODM5YjkyZDEyYzJhMTE5MWVkNDEyODg2ZGU1NmFmZmU4NQ==
5
5
  data.tar.gz: !binary |-
6
- MDBkYmZjZWZjZWY0NTM3ODI2ODZiMDYyODdlYjRmNGZiZmY0YWRkYg==
6
+ M2RkYzJjNGI1NTcwMzQzZjc5MTQ0NDVkNDlmYTcxMGUwYmJiYzJkMA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- N2EwNmZmOWM4MDgwYjA4NmU5YzE0YzYzZTIwMTM0ZmFlYzJlMjA3MDA5MzM5
10
- ZTYwN2Q1NGFiZTA5MmViOTVmMWNiODA0ZmViOTM2YTgyOGMyYTk3NjYzNDU0
11
- MzU2NzhjMjFmMmY1MjJmYjVkNTRkMjVhZDkyNDZkZGE1NDcyODg=
9
+ ODdkNTQzYzAwMDk5N2QzYWE3Y2NmMTdkM2VjZGQ5MWNhZmE2ZmRlNjc0MmJh
10
+ NTY4NTBhMzBmMzY0ZjI4MDM2M2RmMDY1MWE2ZDI3ZTNmNzQ2ZjljYzEzNWVj
11
+ ODc1NWIxNzJlOTgzNzhiMTdhOGE5OWRkZmM3YmNmZDA2NDQ1OTg=
12
12
  data.tar.gz: !binary |-
13
- Y2ZjODEwZTZlNDIyMzM0NGMyNzQ1MzQ4MDE4NTNmMjE1NGQ1OTk4OGJjYzJj
14
- N2E1OWE5NmM5NmRkMGVmMDg0MDE4NjU4ZGExNTkwY2MxYzYyOTBiZDNlZTg5
15
- YTY5YWYxMWFiNzI5MzQxMDliYzM2NmFiYWNiOGFhNTc3YTY4YjU=
13
+ NDA1MzI4ZDVlZGVhYzJlZjBlYjkwYTM0Y2VlZTNlZjUxYWY2MDkxZDY4MmM1
14
+ ZmI5MjJjY2Q2ZDBhZjFlODY4YTQ1M2EzZWE4NzFjNzhlODkzOTYzY2IwZTZh
15
+ ZDBlMjE5ZWJiZDRjMzYzNTY2Zjg5NTJjNmE4ZjQ5ZTRmMTQ1ZjE=
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- singularity_dsl (1.3.2)
4
+ singularity_dsl (1.4.0)
5
5
  mixlib-shellout (~> 1.4)
6
6
  rainbow (~> 2.0.0)
7
7
  rake (~> 10.3)
data/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # SingularityDsl
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/singularity_dsl.svg)](http://badge.fury.io/rb/singularity_dsl)
4
+ [![Dependency Status](https://gemnasium.com/behance/singularity_dsl.svg)](https://gemnasium.com/behance/singularity_dsl)
5
+ [![Code Climate](https://codeclimate.com/github/behance/singularity_dsl/badges/gpa.svg)](https://codeclimate.com/github/behance/singularity_dsl)
6
+
3
7
  A DSL lib for your [SingularityCI](https://github.com/behance/singularity) instance.
4
8
  Inspired by TravisCI's `.travis.yml`
5
9
 
@@ -17,10 +17,18 @@ module SingularityDsl
17
17
  include Stdout
18
18
  include Table
19
19
 
20
+ attr_reader :git
21
+
20
22
  def initialize(*args)
21
23
  super
22
24
  @diff_list = nil
23
25
  @git = GitHelper.new
26
+ envvars = options[:env] || []
27
+ envvars.each do |pair|
28
+ key = pair.split(':', 2).first
29
+ val = pair.split(':', 2).last
30
+ ENV[key] = val
31
+ end
24
32
  end
25
33
 
26
34
  class_option :task_path,
@@ -37,6 +45,9 @@ module SingularityDsl
37
45
  type: :string,
38
46
  desc: 'Specify path to a .singularityrc file',
39
47
  default: './.singularityrc'
48
+ class_option :env,
49
+ type: :array,
50
+ desc: 'EnvVars to set, formatted as VAR:VAL'
40
51
 
41
52
  # TASKS COMMAND
42
53
  desc 'tasks', 'Available tasks.'
@@ -74,7 +85,7 @@ module SingularityDsl
74
85
  desc: 'Run a batch instead, after testmerge.',
75
86
  default: ''
76
87
  def testmerge(git_fork, branch, base_branch, base_fork = nil)
77
- test_merge git_fork, branch, base_branch, base_fork
88
+ @git.merge_refs git_fork, branch, base_branch, base_fork
78
89
  @diff_list = diff_list base_branch, base_fork
79
90
  remove_remotes git_fork, base_fork
80
91
  batch target_run_task if target_run_task
@@ -91,15 +102,6 @@ module SingularityDsl
91
102
  urls.each { |url| @git.remove_remote url }
92
103
  end
93
104
 
94
- def test_merge(git_fork, branch, base_branch, base_fork)
95
- @git.clean_reset
96
- @git.add_remote base_fork
97
- @git.checkout_remote base_branch, base_fork
98
- @git.add_remote git_fork
99
- @git.merge_remote branch, git_fork
100
- @git.install_submodules
101
- end
102
-
103
105
  def target_run_task
104
106
  target = options[:run_task]
105
107
  target = false if target.eql? ''
@@ -47,6 +47,15 @@ module SingularityDsl
47
47
  exec("git remote rm #{remote}")
48
48
  end
49
49
 
50
+ def merge_refs(git_fork, branch, base_branch, base_fork)
51
+ clean_reset
52
+ add_remote base_fork
53
+ checkout_remote base_branch, base_fork
54
+ add_remote git_fork
55
+ merge_remote branch, git_fork
56
+ install_submodules
57
+ end
58
+
50
59
  private
51
60
 
52
61
  def remote_cmd(branch, url, action)
@@ -2,5 +2,5 @@
2
2
 
3
3
  # version const for gem
4
4
  module SingularityDsl
5
- VERSION = '1.3.2'
5
+ VERSION = '1.4.0'
6
6
  end
@@ -7,7 +7,7 @@ describe 'Cli' do
7
7
 
8
8
  context '#testmerge' do
9
9
  before(:each) do
10
- expect(cli).to receive(:test_merge)
10
+ expect(cli.git).to receive(:merge_refs)
11
11
  expect(cli).to receive(:diff_list)
12
12
  expect(cli).to receive(:remove_remotes)
13
13
  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.3.2
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - chr0n1x
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-06 00:00:00.000000000 Z
11
+ date: 2014-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout