vagrant-orchestrate 0.6.3 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc6337e73b1299cc2a5ddfbd7bc634f910c22613
4
- data.tar.gz: c40465611605716c68d8e0a7f547a8471ffe85ea
3
+ metadata.gz: 51dd296ac863762ad204a963f075e5691e877302
4
+ data.tar.gz: 2f4a44895ba86bdaadc9253c14f91b2222a857f2
5
5
  SHA512:
6
- metadata.gz: 3b72416ac1cb3ed860aedf7ecb872df81d57942ad8e5ec90b4802e5e6a4b6e0801fff9c1e0eb573b64ebb816822d504d3285d46aeecd5916c86e603aed3f70d5
7
- data.tar.gz: 4ebd44c1049d983ac78d56458f61d30d4bfbe86f6447a3486c9de35765ef633222e25e4a64164d7b3493cd0a3bf5d152a4be3a07632a32f53a000d51e28869b1
6
+ metadata.gz: b8159b91712a2e1074e560d5705595d3319632180212cfc35c7723b7f7e3d00855a62542a58beeb595dbf00ca21061013e114b2c6aff04a9f5d1b8a6833b4f05
7
+ data.tar.gz: e6a7b2629048d07b61e312eff925e983062092d1361edc9ab6de89506d3ec720be52cbc35e49f8142c8159eba57c88b2cbb5932fa39eae2b4601e0d5da9709d1
data/.gitignore CHANGED
@@ -13,6 +13,6 @@
13
13
  *.a
14
14
  mkmf.log
15
15
 
16
- /.vagrant/
16
+ .vagrant/
17
17
  .DS_Store
18
18
  servers.json
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ 0.6.5 (June 27th, 2015)
2
+
3
+ - Split GIT_BRANCH environment variable on slash and take the last element, since
4
+ that is how Jenkins is providing it. [#40](https://github.com/Cimpress-MCP/vagrant-orchestrate/issues/40)
5
+
6
+ 0.6.4 (June 26th, 2015)
7
+
8
+ - Add common ignores to the `.gitignore` file in the root of the repo unless
9
+ `--no-git` is specified. Fixes [#28](https://github.com/Cimpress-MCP/vagrant-orchestrate/issues/28)
10
+
1
11
  0.6.3 (May 26th, 2015)
2
12
 
3
13
  - Extract the `required_plugins` definition and installation logic from the
data/README.md CHANGED
@@ -172,6 +172,8 @@ Go ahead and push changes to your managed servers, in serial by default.
172
172
 
173
173
  The push command is currently limited to vagrant machines that use the `:managed` provider. So if you have other, local machines defined in the Vagrantfile, `vagrant orchestrate push` will not operate on those.
174
174
 
175
+ Similar to the `up` and `provision` commands in vagrant, the `push` command can take in a regular expression for matching only certain machines. This is useful if your Vagrantfile contains all the managed machines, but you only want to push changes to a subset of those.
176
+
175
177
  ### Filtering managed commands
176
178
  It can be easy to make mistakes such as rebooting a production server if you have managed long-lived servers as well as local VMs defined in your Vagrantfile. We add some protection with the `orchestrate.filter_managed_commands` configuration setting, which will cause up, provision, reload, and destroy commands to be ignored for servers with the managed provider. This can be disabled by setting the variable to false in the Vagrantfile.
177
179
 
@@ -207,6 +209,8 @@ managed-4 2015-04-19 00:43:07 UTC e983dddd8041c5db77494266328f1d266430f57d cb
207
209
  ### Host
208
210
 
209
211
  * Need rsync? Install [OpenSSH](http://www.mls-software.com/opensshd.html) and then run this [script](https://github.com/joefitzgerald/packer-windows/blob/master/scripts/rsync.bat) to install rsync. Vagrant managed servers currently only works with cygwin based rsync implementations.
212
+ * You MUST have at least PowerShell 3 installed in order to use the SMB folder synch. If you have PowerShell
213
+ 2 installed and try to execute a folder sync, it will hang with no good error message.
210
214
 
211
215
  ### Managed Guest
212
216
  You'll need to bootstrap the target machine. The following script should get you there.
@@ -25,6 +25,7 @@ module VagrantPlugins
25
25
  options[:plugins] = DEFAULT_PLUGINS
26
26
  options[:puppet_librarian_puppet] = false
27
27
  options[:puppet_hiera] = true
28
+ options[:git] = true
28
29
 
29
30
  opts = OptionParser.new do |o|
30
31
  o.banner = "Usage: vagrant orchestrate init [options]"
@@ -99,6 +100,8 @@ module VagrantPlugins
99
100
  options[:environments] = list
100
101
  end
101
102
 
103
+ o.on("--[no-]git", "Include useful templates for working in a git repository. Default is true.")
104
+
102
105
  o.on("-f", "--force", "Force overwriting of files") do
103
106
  options[:force] = true
104
107
  end
@@ -116,9 +119,6 @@ module VagrantPlugins
116
119
  argv = parse_options(opts)
117
120
  return unless argv
118
121
 
119
- init_puppet options
120
- init_environments options
121
-
122
122
  options[:shell_paths] ||= options[:shell_inline] ? [] : [DEFAULT_SHELL_PATH]
123
123
  options[:winrm_username] ||= DEFAULT_WINRM_USERNAME
124
124
  options[:winrm_password] ||= DEFAULT_WINRM_PASSWORD
@@ -126,7 +126,10 @@ module VagrantPlugins
126
126
  options[:ssh_username] ||= DEFAULT_SSH_USERNAME
127
127
  options[:ssh_private_key_path] ||= DEFAULT_SSH_PRIVATE_KEY_PATH unless options[:ssh_password]
128
128
 
129
- write_vagrant_files(options)
129
+ init_puppet options
130
+ init_environments options
131
+ init_vagrant_files options
132
+ init_git options
130
133
  @env.ui.info(I18n.t("vagrant.commands.init.success"), prefix: false)
131
134
 
132
135
  # Success, exit status 0
@@ -136,30 +139,6 @@ module VagrantPlugins
136
139
 
137
140
  private
138
141
 
139
- def write_vagrant_files(options)
140
- contents = TemplateRenderer.render(Orchestrate.source_root.join("templates/vagrant/Vagrantfile"),
141
- provisioners: options[:provisioners], shell_paths: options[:shell_paths],
142
- shell_inline: options[:shell_inline],
143
- puppet_librarian_puppet: options[:puppet_librarian_puppet],
144
- puppet_hiera: options[:puppet_hiera], communicator: options[:communicator],
145
- winrm_username: options[:winrm_username],
146
- winrm_password: options[:winrm_password],
147
- ssh_username: options[:ssh_username], ssh_password: options[:ssh_password],
148
- ssh_private_key_path: options[:ssh_private_key_path],
149
- servers: options[:servers],
150
- environments: options[:environments], creds_prompt: options[:creds_prompt]
151
- )
152
- write_file("Vagrantfile", contents, options)
153
-
154
- contents = TemplateRenderer.render(Orchestrate.source_root.join("templates/vagrant/.vagrantplugins"),
155
- plugins: options[:plugins]
156
- )
157
- write_file(".vagrantplugins", contents, options)
158
-
159
- FileUtils.cp(Orchestrate.source_root.join("templates", "vagrant", "dummy.box"),
160
- File.join(@env.cwd, "dummy.box"))
161
- end
162
-
163
142
  def init_puppet(options)
164
143
  return unless options[:provisioners].include? "puppet"
165
144
 
@@ -168,7 +147,7 @@ module VagrantPlugins
168
147
  contents = TemplateRenderer.render(Orchestrate.source_root.join("templates/puppet/Puppetfile"))
169
148
  write_file File.join("puppet", "Puppetfile"), contents, options
170
149
  FileUtils.mkdir_p(File.join(@env.cwd, "puppet", "modules"))
171
- write_file(File.join(@env.cwd, "puppet", "modules", ".gitignore"), "*", options)
150
+ write_file(File.join(@env.cwd, "puppet", "modules", ".gitignore"), "*", options) if options[:git]
172
151
  options[:plugins] << "vagrant-librarian-puppet"
173
152
  end
174
153
 
@@ -202,6 +181,44 @@ module VagrantPlugins
202
181
  end
203
182
  end
204
183
 
184
+ def init_vagrant_files(options)
185
+ contents = TemplateRenderer.render(Orchestrate.source_root.join("templates/vagrant/Vagrantfile"),
186
+ provisioners: options[:provisioners], shell_paths: options[:shell_paths],
187
+ shell_inline: options[:shell_inline],
188
+ puppet_librarian_puppet: options[:puppet_librarian_puppet],
189
+ puppet_hiera: options[:puppet_hiera], communicator: options[:communicator],
190
+ winrm_username: options[:winrm_username],
191
+ winrm_password: options[:winrm_password],
192
+ ssh_username: options[:ssh_username], ssh_password: options[:ssh_password],
193
+ ssh_private_key_path: options[:ssh_private_key_path],
194
+ servers: options[:servers],
195
+ environments: options[:environments], creds_prompt: options[:creds_prompt]
196
+ )
197
+ write_file("Vagrantfile", contents, options)
198
+
199
+ contents = TemplateRenderer.render(Orchestrate.source_root.join("templates/vagrant/.vagrantplugins"),
200
+ plugins: options[:plugins]
201
+ )
202
+ write_file(".vagrantplugins", contents, options)
203
+
204
+ FileUtils.cp(Orchestrate.source_root.join("templates", "vagrant", "dummy.box"),
205
+ File.join(@env.cwd, "dummy.box"))
206
+ end
207
+
208
+ def init_git(options)
209
+ return unless options[:git]
210
+
211
+ gitignore_path = File.join(@env.cwd, ".gitignore")
212
+ contents = ::IO.readlines(gitignore_path) if File.exist?(gitignore_path)
213
+ contents ||= []
214
+
215
+ open(gitignore_path, "a") do |f|
216
+ %w( .vagrant/ ).each do |path|
217
+ f.puts path unless contents.include?(path + "\n")
218
+ end
219
+ end
220
+ end
221
+
205
222
  def write_file(filename, contents, options)
206
223
  save_path = Pathname.new(filename).expand_path(@env.cwd)
207
224
  save_path.delete if save_path.exist? && options[:force]
@@ -85,8 +85,8 @@ module VagrantPlugins
85
85
 
86
86
  def self.read_git_branch
87
87
  @logger.debug("Reading git branch")
88
- if ENV["GIT_BRANCH"]
89
- git_branch = ENV["GIT_BRANCH"]
88
+ if ENV.key?("GIT_BRANCH")
89
+ git_branch = ENV["GIT_BRANCH"].split("/").last
90
90
  @logger.debug("Read git branch #{git_branch} from GIT_BRANCH environment variable")
91
91
  else
92
92
  command = "git rev-parse --abbrev-ref HEAD 2>&1"
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Orchestrate
3
- VERSION = "0.6.3"
3
+ VERSION = "0.6.5"
4
4
  end
5
5
  end
@@ -307,6 +307,21 @@ describe VagrantPlugins::Orchestrate::Command::Init do
307
307
  end
308
308
  end
309
309
 
310
+ context "git" do
311
+ describe ".gitignore" do
312
+ it "is written" do
313
+ subject.execute
314
+ expect(Dir.entries(iso_env.cwd)).to include(".gitignore")
315
+ end
316
+
317
+ it "contains ignored paths" do
318
+ subject.execute
319
+ contents = File.readlines(File.join(iso_env.cwd, ".gitignore")).join
320
+ expect(contents).to include(".vagrant/")
321
+ end
322
+ end
323
+ end
324
+
310
325
  context "box" do
311
326
  describe "dummy.box" do
312
327
  it "winds up in the target directory" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-orchestrate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Baldauf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-26 00:00:00.000000000 Z
11
+ date: 2015-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler