vagrant-orchestrate 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -1
- data/CHANGELOG.md +4 -0
- data/README.md +18 -16
- data/Rakefile +1 -0
- data/acceptance/command/status_spec.rb +2 -1
- data/lib/vagrant-orchestrate/command/push.rb +2 -11
- data/lib/vagrant-orchestrate/repo_status.rb +17 -0
- data/lib/vagrant-orchestrate/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: 997cea86aee854008a850c48c1593a03d1d543fd
|
4
|
+
data.tar.gz: b3779aab0db5c26a0e9490aa21ac9015f0f0b6d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ad720a6e0e8f172b4f01507764537eb52f4fdec5f7d72308a799870809d65bedd69b831ec2d7b3813735549c517e4af910a15f8fd9a6bc616706fa8c2293e0a
|
7
|
+
data.tar.gz: 005dd4b6c151cd3c09b9cc688f59f9137b2d0c7832ddd54d5afc5f8b48bd4556a06801e9e96189c683cb3d496ad42ff1e5aea03d50c3098150af7ce9cc27bbc4
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
0.5.1 (April 27th, 2015)
|
2
|
+
|
3
|
+
- Also short circuit a push operation with an error message if there are untracked files.
|
4
|
+
|
1
5
|
0.5.0 (April 22, 2015)
|
2
6
|
|
3
7
|
- Add guard_clean so that a push will fail if there are uncommitted files. Override with VAGRANT_ORCHESTRATE_NO_GUARD_CLEAN
|
data/README.md
CHANGED
@@ -6,17 +6,19 @@
|
|
6
6
|
![](http://i.imgur.com/71yAw5v.gif)
|
7
7
|
|
8
8
|
This is a Vagrant 1.6+ plugin that allows orchestrated deployments
|
9
|
-
to already provisioned (non-elastic) servers on top of the excellent vagrant-managed-servers plugin.
|
10
|
-
It features a powerful templating `init` command
|
11
|
-
ground up to be cross-platform, with first class support for **Windows,
|
9
|
+
to already provisioned (non-elastic) servers on top of the excellent [vagrant-managed-servers](http://github.com/tknerr/vagrant-managed-servers) plugin.
|
10
|
+
It features a powerful templating `init` command, support for multiple environments, several deployment strategies
|
11
|
+
and is designed from the ground up to be cross-platform, with first class support for **Windows,
|
12
12
|
Linux, and Mac**.
|
13
13
|
|
14
14
|
## Quick start
|
15
15
|
|
16
16
|
```
|
17
|
-
$ vagrant orchestrate init --shell --shell-inline "echo Hello
|
17
|
+
$ vagrant orchestrate init --shell --shell-inline "echo Hello" \
|
18
18
|
--servers myserver1.mydomain.com,myserver2.mydomain.com \
|
19
19
|
--ssh-username USERNAME --ssh-private-key-path PATH
|
20
|
+
$ ls
|
21
|
+
Vagrantfile dummy.box
|
20
22
|
$ vagrant orchestrate push
|
21
23
|
==> managed-myserver1.mydomain.com: Linking vagrant with managed server myserver1.mydomain.com
|
22
24
|
==> managed-myserver1.mydomain.com: -- Server: myserver1.mydomain.com
|
@@ -36,7 +38,7 @@ $ vagrant orchestrate push
|
|
36
38
|
==> managed-myserver2.mydomain.com: -- Server: myserver2.mydomain.com
|
37
39
|
```
|
38
40
|
|
39
|
-
This also works for Windows with the `--winrm --winrm-username --wirnm-password` parameters, but currently must be initiated from a Windows host.
|
41
|
+
This also works for Windows with the `--winrm --winrm-username USERNAME --wirnm-password PASSWORD` parameters, but currently must be initiated from a Windows host.
|
40
42
|
|
41
43
|
## Usage
|
42
44
|
|
@@ -123,10 +125,10 @@ To initialize an environment aware Vagrantfile, use
|
|
123
125
|
|
124
126
|
$ vagrant orchestrate init --environments dev,test,prod
|
125
127
|
|
126
|
-
You'll need to create git branches with matching names and
|
128
|
+
You'll need to create git branches with matching names and enter data into the the servers.json
|
127
129
|
file in order for the Vagrantfile to be git branch aware.
|
128
130
|
|
129
|
-
Learn more about [environments](docs/environments.md)
|
131
|
+
Learn more about [environments](docs/environments.md).
|
130
132
|
|
131
133
|
#### Credentials
|
132
134
|
|
@@ -158,7 +160,14 @@ Go ahead and push changes to your managed servers, in serial by default.
|
|
158
160
|
|
159
161
|
$ vagrant orchestrate push
|
160
162
|
|
161
|
-
The push command is currently limited
|
163
|
+
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.
|
164
|
+
|
165
|
+
### Filtering managed commands
|
166
|
+
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.
|
167
|
+
|
168
|
+
```ruby
|
169
|
+
config.orchestrate.filter_managed_commands = true
|
170
|
+
```
|
162
171
|
|
163
172
|
#### Deployment Strategy
|
164
173
|
|
@@ -183,13 +192,6 @@ managed-3 Status unavailable.
|
|
183
192
|
managed-4 2015-04-19 00:43:07 UTC e983dddd8041c5db77494266328f1d266430f57d cbaldauf
|
184
193
|
```
|
185
194
|
|
186
|
-
## Filtering managed commands
|
187
|
-
It can be easy to make mistakes such as rebooting production 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.
|
188
|
-
|
189
|
-
```ruby
|
190
|
-
config.orchestrate.filter_managed_commands = true
|
191
|
-
```
|
192
|
-
|
193
195
|
## Tips for Windows hosts
|
194
196
|
|
195
197
|
* 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.
|
@@ -210,6 +212,6 @@ Prerequisites:
|
|
210
212
|
|
211
213
|
Flow:
|
212
214
|
1. Develop your feature
|
213
|
-
2.
|
215
|
+
2. Run locally with `bundle exec vagrant orchestrate [init|push|status]`
|
214
216
|
3. `bundle exec rake build`
|
215
217
|
4. `bundle exec rake acceptance`, which will take a few minutes
|
data/Rakefile
CHANGED
@@ -16,6 +16,7 @@ task :acceptance do
|
|
16
16
|
system("vagrant up /local/ --no-provision")
|
17
17
|
# To ensure the ntp sync happens even if the servers are already up
|
18
18
|
system("vagrant provision /local/")
|
19
|
+
ENV["VAGRANT_ORCHESTRATE_NO_GUARD_CLEAN"] = "true"
|
19
20
|
system("bundle exec vagrant-spec test --components=orchestrate/push orchestrate/prompt orchestrate/status")
|
20
21
|
puts "Destroying target servers"
|
21
22
|
system("vagrant destroy -f /local/")
|
@@ -13,7 +13,7 @@ describe "vagrant orchestrate status", component: "orchestrate/status" do
|
|
13
13
|
|
14
14
|
it "handles no status file gracefully" do
|
15
15
|
# Make sure we're starting from a clean slate, rspec order isn't guaranteed.
|
16
|
-
execute("vagrant", "ssh", "-c", "\"rm -rf /var/state/vagrant_orchestrate\"
|
16
|
+
execute("vagrant", "ssh", "-c", "\"rm -rf /var/state/vagrant_orchestrate\" managed-1")
|
17
17
|
# All commands are executed against a single machine to reduce variability
|
18
18
|
result = execute("vagrant", "orchestrate", "status", "/managed-1/")
|
19
19
|
expect(result.stdout).to include("Status unavailable.")
|
@@ -25,6 +25,7 @@ describe "vagrant orchestrate status", component: "orchestrate/status" do
|
|
25
25
|
# environment variables. See vagrant-orchestrate/repo_status.rb for impl.
|
26
26
|
ENV["VAGRANT_ORCHESTRATE_STATUS_TEST_REF"] = TEST_REF
|
27
27
|
ENV["VAGRANT_ORCHESTRATE_STATUS_TEST_REMOTE_ORIGIN_URL"] = TEST_REMOTE_ORIGIN_URL
|
28
|
+
ENV["VAGRANT_ORCHESTRATE_NO_GUARD_CLEAN"] = "true"
|
28
29
|
execute("vagrant", "orchestrate", "push", "/managed-1/")
|
29
30
|
result = execute("vagrant", "orchestrate", "status", "/managed-1/")
|
30
31
|
status = VagrantPlugins::Orchestrate::RepoStatus.new
|
@@ -162,17 +162,8 @@ module VagrantPlugins
|
|
162
162
|
end
|
163
163
|
|
164
164
|
def guard_clean
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
def clean?
|
169
|
-
`git diff --exit-code 2>&1`
|
170
|
-
$CHILD_STATUS == 0
|
171
|
-
end
|
172
|
-
|
173
|
-
def committed?
|
174
|
-
`git diff-index --quiet --cached HEAD 2>&1`
|
175
|
-
$CHILD_STATUS == 0
|
165
|
+
message = "ERROR!\nThere are files that need to be committed first."
|
166
|
+
RepoStatus.clean? && RepoStatus.committed? && !RepoStatus.untracked? || abort(message)
|
176
167
|
end
|
177
168
|
|
178
169
|
def upload_status_all(machines)
|
@@ -56,6 +56,23 @@ module VagrantPlugins
|
|
56
56
|
File.join("/var", "state", "vagrant_orchestrate", repo)
|
57
57
|
end
|
58
58
|
end
|
59
|
+
|
60
|
+
def self.clean?
|
61
|
+
`git diff --exit-code 2>&1`
|
62
|
+
$CHILD_STATUS == 0
|
63
|
+
end
|
64
|
+
|
65
|
+
def self.committed?
|
66
|
+
`git diff-index --quiet --cached HEAD 2>&1`
|
67
|
+
$CHILD_STATUS == 0
|
68
|
+
end
|
69
|
+
|
70
|
+
# Return whether there are any untracked files in the git repo
|
71
|
+
def self.untracked?
|
72
|
+
output = `git ls-files --other --exclude-standard --directory --no-empty-directory 2>&1`
|
73
|
+
# This command lists untracked files. There are untracked files if the ouput is not empty.
|
74
|
+
!output.empty?
|
75
|
+
end
|
59
76
|
end
|
60
77
|
end
|
61
78
|
end
|
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.5.
|
4
|
+
version: 0.5.1
|
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-04-
|
11
|
+
date: 2015-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|