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 +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +2 -2
- data/bin/armature +3 -3
- data/lib/armature/environments.rb +1 -2
- data/lib/armature/gitrepo.rb +4 -4
- data/lib/armature/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0a8b80f2d44ce34400277ea4760820da4e6fd66
|
4
|
+
data.tar.gz: 2857d139910bfb9e29700ec61a318f5162ce64a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00efc4bd4c00da1f8547a31be2c83db2bed1dc5dabb62ebbc5a5100808a7a87449e5a19c7b3b9b99b5b0499c27267d13b807cb9f4dcda278df3fc5cf815184bf
|
7
|
+
data.tar.gz: 4e4c492d820316e324c9cde18b37d7bbd76dce885df2231b6523e6405a3296e7c69b64542464d206bd1627b42ac879d529b1ed2c2f3354093d074ff90f64d883
|
data/Gemfile.lock
CHANGED
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-
|
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-
|
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-
|
68
|
+
command "deploy-branches" do |c|
|
69
69
|
c.desc "Delete environments that aren't being deployed"
|
70
|
-
c.switch [:d,"delete-
|
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-
|
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
|
-
|
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
|
|
data/lib/armature/gitrepo.rb
CHANGED
@@ -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
|
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,
|
60
|
-
ref = "refs/heads/#{branch}"
|
59
|
+
sha, ref = line.split(' ', 2)
|
61
60
|
@ref_cache[ref] = [:mutable, sha, ref]
|
62
|
-
|
61
|
+
# Strip refs/heads/ from the beginning of each ref
|
62
|
+
ref["refs/heads/".length .. -1]
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
data/lib/armature/version.rb
CHANGED
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.
|
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:
|
11
|
+
date: 2017-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gli
|