ra10ke 0.4.0 → 0.5.0

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
  SHA256:
3
- metadata.gz: 54a37104f6389b661c4b4a8673a2e9ad2dd502c02586b934dc948d94312eb0b6
4
- data.tar.gz: aa3292d5cca1ebe7247e9796787d76fc7e79792d77fbef1c8274f15f9468ac16
3
+ metadata.gz: 5ad7a9bc9ed535980433aee2a10afc3fe6b0060b9b85764fc692e1086bfabf46
4
+ data.tar.gz: b1c37034b07281ffe040748f34339acfd4cb0f82a014c4512463e077c645778b
5
5
  SHA512:
6
- metadata.gz: cda904312f96b957f9a93b83ec9dee7a94fa2e200cf2ae2eb43781c15c10637f985f46ab7f6e7be114f1befd4486d8a156eb7166d9342428b52ec7a19738d0ec
7
- data.tar.gz: 7bca30b657f0b072662b4aef38ae7269fa6a94d472a18ec0cad5270e05a06bc6b8f0b4aa7a3f165b281bf6755fae570358783a5d62c360bb4cf62d859a7f8145
6
+ metadata.gz: 041f1c23f5cb71e8adbd419c9fd8a1b3662c536d5d5cbf7e2410db2c8d9f3c9e47673f257e29bb3a3ab900700f4bb219261e1d38d2b101983a828f33f1c2b5c6
7
+ data.tar.gz: 9fc86d2fe74f4c866cf1a4de68fb0dae662a952a4d9f5402ae983a966e607bad1bbec5f4943bdc5b29ba039d9bf5e9e5867711de5bc89e7c40b20c2056b018e1
@@ -0,0 +1,25 @@
1
+ ---
2
+ dist: xenial
3
+ sudo: false
4
+ language: ruby
5
+ rvm:
6
+ - '2.3'
7
+ - '2.4'
8
+ - '2.5'
9
+ deploy:
10
+ provider: rubygems
11
+ api_key:
12
+ secure: "Vnvr7VC8HI3ccJhvDXv7cFqMtMjaOFzUKpM7tte0o2jDybt7XiOlOqGt6qrZ/dDtla7zYa1tgdNzDCbzWxYaZnRLW2v10wiwFrbDHCZTYPq82w4FtdIv04qymG5CnxsW7MyrZ/jUTzbwpEJyUTMuHE8u00aTewZ8Xdm43MuAVOerQneZQ22uzK3S0p6hW4iXkO7GnBln/BPxMaAzheB6NXpprBJEGL86Hb5M4N7qrxcv4SKepTnvap/DM3M95m9QyxJ0TJ2+CivltPclDByH/WgsFwehd6wYcS+9HBLM6Acg8vM167Dii88v8yBzYwF2lIL8I4LoVX1yaBlwey/VpnYSfkrmknDQ9jkBRYVDPp+6ur4h2atfww96TBObLW9HmbE0xLneCiXeZjuG+ty34HixJgeEFh2w9wtBvEdxjudvkx/IkUtAwyoTLdVSRsyDRI6Vh8z53G3abiLQCgSUqgQlkH6dISSxIODhxhklLlOE7MXn5p1uaotFdpa9o2OA79FEdAQNc42MCPglid/Xtp0CN0FlPyt2t9I1iwF7UpgsUIcydVwm9PaHNMQo5PgnfWyvIY/JPrlVt57bEcu8nBqWr4QTmNAuBTSeXGoGYV+gJfNscT5yw5BjVS07D85z9X3zniHUuMDH3vu1Pz4SBzz55R31qWfE0Ikcd4Jxo+A="
13
+ gem: ra10ke
14
+ on:
15
+ tags: true
16
+ repo: voxpupuli/ra10ke
17
+ rvm: '2.5'
18
+
19
+ notifications:
20
+ email: false
21
+ irc:
22
+ on_success: always
23
+ on_failure: always
24
+ channels:
25
+ - "chat.freenode.org#voxpupuli-notifications"
@@ -1,6 +1,18 @@
1
1
  CHANGELOG
2
2
  =========
3
3
 
4
+ 0.5.0
5
+ -----
6
+
7
+ 2018-12-26
8
+
9
+ Closed Pull Requests:
10
+
11
+ * [#22](https://github.com/voxpupuli/ra10ke/pull/22) Add rudimentary r10k:install task
12
+ * [#26](https://github.com/voxpupuli/ra10ke/pull/26) make use of the forge command in puppetfile
13
+ * [#29](https://github.com/voxpupuli/ra10ke/pull/29) Abort (exit 1) if Puppetfile syntax check fails
14
+ * [#30](https://github.com/voxpupuli/ra10ke/pull/30) enable travis deployment
15
+
4
16
  0.4.0
5
17
  -----
6
18
 
data/README.md CHANGED
@@ -52,6 +52,10 @@ The rake task will download git modules into the modules/ directory to access th
52
52
  It will also cache forge metadata in ̃$XDG_CACHE_DIR/ra10ke.metadata_cache in order to make subsequent
53
53
  runs faster.
54
54
 
55
+ ### r10k:install[path]
56
+
57
+ Reads the Puppetfile in the current directory and installs them under the `path` provided as an argument.
58
+
55
59
  #### Limitations
56
60
 
57
61
  * It works only with modules from the [Forge](https://forge.puppetlabs.com), and Git.
@@ -0,0 +1,10 @@
1
+ require 'rake'
2
+ require 'rake/clean'
3
+ require 'rubygems'
4
+ require 'bundler/gem_tasks'
5
+ require 'fileutils'
6
+
7
+ CLEAN.include("pkg/", "tmp/")
8
+ CLOBBER.include("Gemfile.lock")
9
+
10
+ task :default => [:clean, :build]
@@ -17,6 +17,7 @@ module Ra10ke
17
17
  PuppetForge.user_agent = "ra10ke/#{Ra10ke::VERSION}"
18
18
  puppetfile = R10K::Puppetfile.new(Dir.pwd)
19
19
  puppetfile.load!
20
+ PuppetForge.host = puppetfile.forge if puppetfile.forge =~ /^http/
20
21
 
21
22
  # ignore file allows for "don't tell me about this"
22
23
  ignore_modules = []
@@ -84,8 +85,51 @@ module Ra10ke
84
85
  :moduledir => nil,
85
86
  :puppetfile => nil
86
87
  }, '')
87
- puppetfile.call
88
+
89
+ unless puppetfile.call
90
+ abort("Puppetfile syntax check failed")
91
+ end
88
92
  end
93
+
94
+ desc "Install modules specified in Puppetfile"
95
+ task :install, [:path] do |_, args|
96
+ require 'r10k/puppetfile'
97
+ require 'pathname'
98
+
99
+ if !args.has_key?(:path)
100
+ raise "task requires 'path' argument"
101
+ end
102
+ modpath = Pathname.new args[:path]
103
+
104
+ if !modpath.absolute?
105
+ modpath = Pathname.new(Dir.pwd) + modpath
106
+ end
107
+
108
+ puppetfile_dir = Pathname.new Dir.pwd
109
+ modules_dir = File.join(puppetfile_dir, modpath.relative_path_from(puppetfile_dir))
110
+ puppetfile = R10K::Puppetfile.new(puppetfile_dir, modules_dir)
111
+ puppetfile.load!
112
+
113
+ puts "Processing Puppetfile for fixtures"
114
+ puppetfile.modules.each do |mod|
115
+ if mod.status == :insync
116
+ puts "Skipping #{mod.name} (#{mod.version}) already in sync"
117
+ else
118
+ if mod.status == :absent
119
+ msg = "installed #{mod.name}"
120
+ else
121
+ msg = "updated #{mod.name} from #{mod.version} to"
122
+ end
123
+ mod.sync
124
+ if mod.status != :insync
125
+ puts "Failed to sync #{mod.name}".red
126
+ else
127
+ puts "Successfully #{msg} #{mod.version}".green
128
+ end
129
+ end
130
+ end
131
+ end
132
+
89
133
  end
90
134
  end
91
135
  end
@@ -28,6 +28,7 @@ module Ra10ke::Solve
28
28
  PuppetForge.user_agent = "ra10ke/#{Ra10ke::VERSION}"
29
29
  puppetfile = R10K::Puppetfile.new(Dir.pwd)
30
30
  puppetfile.load!
31
+ PuppetForge.host = puppetfile.forge if puppetfile.forge =~ /^http/
31
32
 
32
33
  # ignore file allows for "don't tell me about this"
33
34
  ignore_modules = []
@@ -1,3 +1,3 @@
1
1
  module Ra10ke
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ra10ke
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Theo Chatzimichos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-17 00:00:00.000000000 Z
11
+ date: 2018-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -102,10 +102,12 @@ extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
104
  - ".gitignore"
105
+ - ".travis.yml"
105
106
  - CHANGELOG.md
106
107
  - Gemfile
107
108
  - LICENSE.txt
108
109
  - README.md
110
+ - Rakefile
109
111
  - lib/ra10ke.rb
110
112
  - lib/ra10ke/solve.rb
111
113
  - lib/ra10ke/version.rb
@@ -130,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
132
  version: '0'
131
133
  requirements: []
132
134
  rubyforge_project:
133
- rubygems_version: 2.7.3
135
+ rubygems_version: 2.7.7
134
136
  signing_key:
135
137
  specification_version: 4
136
138
  summary: Syntax check for the Puppetfile, check for outdated installed puppet modules