puppet-armature 0.2.1 → 0.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1cf1d192c7f3bd7e27b82ded9f4a8fa5e7277647
4
- data.tar.gz: d5882f18aa5102f3adb6068bf7c0cc97194c0ecf
3
+ metadata.gz: f0a8b80f2d44ce34400277ea4760820da4e6fd66
4
+ data.tar.gz: 2857d139910bfb9e29700ec61a318f5162ce64a5
5
5
  SHA512:
6
- metadata.gz: 28a7b7c5e6937603dca25c7a63bf9bf33fb03258414397c5a722eff52df61ab5211c830296e05c6ef64a91688d26b1c6a04c6761fa923b328f0d84186cca7051
7
- data.tar.gz: cfa8e3b8f55bbe670f870bb3b773277ffbf4009e0ca6728b9e4f727d8963c258ffbb737c8e43fa898a1bcef04536461cf713af1a944f735d2b0556d85f8eb0e0
6
+ metadata.gz: 00efc4bd4c00da1f8547a31be2c83db2bed1dc5dabb62ebbc5a5100808a7a87449e5a19c7b3b9b99b5b0499c27267d13b807cb9f4dcda278df3fc5cf815184bf
7
+ data.tar.gz: 4e4c492d820316e324c9cde18b37d7bbd76dce885df2231b6523e6405a3296e7c69b64542464d206bd1627b42ac879d529b1ed2c2f3354093d074ff90f64d883
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- armature (0.1.0)
4
+ puppet-armature (0.2.2)
5
5
  gli (= 2.14.0)
6
6
  logging (~> 2)
7
7
 
@@ -19,7 +19,7 @@ PLATFORMS
19
19
  ruby
20
20
 
21
21
  DEPENDENCIES
22
- armature!
22
+ puppet-armature!
23
23
 
24
24
  BUNDLED WITH
25
25
  1.10.4
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  A tool for deploying Puppet environments and modules.
4
4
 
5
5
  ~~~
6
- $ armature deploy-branch my-puppet-code.git '*'
6
+ $ armature deploy-branches my-puppet-code.git '*'
7
7
  ~~~
8
8
 
9
9
  Armature sets up Puppet environments for each branch in your control repo and
@@ -34,7 +34,7 @@ _This is an alpha release. The interface is likely to change significantly._
34
34
  There are three commands you need to use. Run `armature help` to learn about
35
35
  options, or `armature help <command>` to learn about a specific command.
36
36
 
37
- ### `armature deploy-branch <git-url> <branch>`
37
+ ### `armature deploy-branches <git-url> <branch>`
38
38
 
39
39
  Deploys branches from a git repository as environments.
40
40
 
data/bin/armature CHANGED
@@ -65,9 +65,9 @@ long_desc 'This accepts globs to match branch names. For example, specify "*"
65
65
  to deploy all branches.'
66
66
  arg 'GIT_URL'
67
67
  arg 'BRANCH', :multiple=>true
68
- command "deploy-branch" do |c|
68
+ command "deploy-branches" do |c|
69
69
  c.desc "Delete environments that aren't being deployed"
70
- c.switch [:d,"delete-old"]
70
+ c.switch [:d,"delete-other"]
71
71
  c.action do |global_options, options, arguments|
72
72
  # This should fail as early as possible (e.g. if the path isn't correct)
73
73
  environments = Armature::Environments.new(@environments_path, @cache)
@@ -88,7 +88,7 @@ command "deploy-branch" do |c|
88
88
  end
89
89
  end
90
90
 
91
- if options["delete-old"]
91
+ if options["delete-other"]
92
92
  (Set.new(environments.names()) - branches).each do |name|
93
93
  environments.remove(name)
94
94
  end
@@ -30,8 +30,7 @@ module Armature
30
30
  # used in a Puppetfile. (Perhaps the cache is used for multiple repos?)
31
31
 
32
32
  # https://docs.puppet.com/puppet/latest/reference/lang_reserved.html#environments
33
- # The docs are slightly wrong; A-Z are allowed.
34
- if name !~ /\A[a-z0-9_]+\Z/i
33
+ if name !~ /\A[a-z0-9_]+\Z/
35
34
  raise "Invalid environment name '#{name}'"
36
35
  end
37
36
 
@@ -51,15 +51,15 @@ module Armature
51
51
  def get_branches()
52
52
  freshen()
53
53
  data = git("for-each-ref",
54
- "--format", "%(objectname) %(refname:strip=2)",
54
+ "--format", "%(objectname) %(refname)",
55
55
  "refs/heads")
56
56
  lines = data.split(/[\r\n]/).reject { |line| line == "" }
57
57
 
58
58
  lines.map do |line|
59
- sha, branch = line.split(' ', 2)
60
- ref = "refs/heads/#{branch}"
59
+ sha, ref = line.split(' ', 2)
61
60
  @ref_cache[ref] = [:mutable, sha, ref]
62
- branch
61
+ # Strip refs/heads/ from the beginning of each ref
62
+ ref["refs/heads/".length .. -1]
63
63
  end
64
64
  end
65
65
 
@@ -1,3 +1,3 @@
1
1
  module Armature
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-armature
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Parks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-29 00:00:00.000000000 Z
11
+ date: 2017-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli