webbynode 0.1.2 → 0.2.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.
- data/Manifest +88 -4
- data/PostInstall.txt +42 -9
- data/README.rdoc +6 -0
- data/Rakefile +16 -19
- data/assets/webbynode.png +0 -0
- data/bin/webbynode +3 -3
- data/bin/wn +7 -0
- data/cucumber.yml +1 -0
- data/devver.rake +174 -0
- data/features/bootstrap.feature +17 -0
- data/features/step_definitions/command_steps.rb +14 -0
- data/features/support/env.rb +22 -0
- data/features/support/hooks.rb +8 -0
- data/{test/test_webbynode.rb → features/support/io_features.rb} +0 -0
- data/features/support/mocha.rb +15 -0
- data/lib/templates/api_token +14 -0
- data/lib/templates/backup +15 -0
- data/lib/templates/gitignore +4 -0
- data/lib/templates/help +53 -0
- data/lib/webbynode/api_client.rb +121 -0
- data/lib/webbynode/application.rb +21 -0
- data/lib/webbynode/command.rb +332 -0
- data/lib/webbynode/commands/add_backup.rb +33 -0
- data/lib/webbynode/commands/add_key.rb +24 -0
- data/lib/webbynode/commands/alias.rb +153 -0
- data/lib/webbynode/commands/change_dns.rb +29 -0
- data/lib/webbynode/commands/config.rb +15 -0
- data/lib/webbynode/commands/delete.rb +25 -0
- data/lib/webbynode/commands/help.rb +25 -0
- data/lib/webbynode/commands/init.rb +77 -0
- data/lib/webbynode/commands/push.rb +70 -0
- data/lib/webbynode/commands/remote.rb +28 -0
- data/lib/webbynode/commands/restart.rb +25 -0
- data/lib/webbynode/commands/start.rb +23 -0
- data/lib/webbynode/commands/stop.rb +23 -0
- data/lib/webbynode/commands/tasks.rb +149 -0
- data/lib/webbynode/commands/version.rb +8 -0
- data/lib/webbynode/commands/webbies.rb +30 -0
- data/lib/webbynode/git.rb +112 -0
- data/lib/webbynode/io.rb +175 -0
- data/lib/webbynode/notify.rb +19 -0
- data/lib/webbynode/option.rb +84 -0
- data/lib/webbynode/parameter.rb +27 -0
- data/lib/webbynode/properties.rb +43 -0
- data/lib/webbynode/push_and.rb +16 -0
- data/lib/webbynode/remote_executor.rb +21 -0
- data/lib/webbynode/server.rb +39 -0
- data/lib/webbynode/ssh.rb +65 -0
- data/lib/webbynode/ssh_keys.rb +36 -0
- data/lib/webbynode.rb +56 -0
- data/spec/fixtures/aliases +0 -0
- data/spec/fixtures/api/credentials +3 -0
- data/spec/fixtures/api/dns +30 -0
- data/spec/fixtures/api/dns_a_record +20 -0
- data/spec/fixtures/api/dns_a_record_already_exists +15 -0
- data/spec/fixtures/api/dns_a_record_error +13 -0
- data/spec/fixtures/api/dns_new_zone +17 -0
- data/spec/fixtures/api/webbies +26 -0
- data/spec/fixtures/api/webbies_unauthorized +12 -0
- data/spec/fixtures/api/webby +6 -0
- data/spec/fixtures/commands/tasks/after_push +3 -0
- data/spec/fixtures/fixture_helpers +2 -0
- data/spec/fixtures/git/config/210.11.13.12 +9 -0
- data/spec/fixtures/git/config/67.23.79.31 +9 -0
- data/spec/fixtures/git/config/67.23.79.32 +9 -0
- data/spec/fixtures/git/config/config +9 -0
- data/spec/fixtures/git/status/clean +2 -0
- data/spec/fixtures/git/status/dirty +9 -0
- data/spec/fixtures/pushand +2 -0
- data/spec/spec_helper.rb +58 -0
- data/spec/webbynode/api_client_spec.rb +227 -0
- data/spec/webbynode/application_spec.rb +50 -0
- data/spec/webbynode/command_spec.rb +285 -0
- data/spec/webbynode/commands/add_backup_spec.rb +66 -0
- data/spec/webbynode/commands/add_key_spec.rb +58 -0
- data/spec/webbynode/commands/alias_spec.rb +213 -0
- data/spec/webbynode/commands/change_dns_spec.rb +51 -0
- data/spec/webbynode/commands/config_spec.rb +22 -0
- data/spec/webbynode/commands/delete_spec.rb +78 -0
- data/spec/webbynode/commands/help_spec.rb +43 -0
- data/spec/webbynode/commands/init_spec.rb +326 -0
- data/spec/webbynode/commands/push_spec.rb +175 -0
- data/spec/webbynode/commands/remote_spec.rb +76 -0
- data/spec/webbynode/commands/tasks_spec.rb +288 -0
- data/spec/webbynode/commands/version_spec.rb +18 -0
- data/spec/webbynode/commands/webbies_spec.rb +27 -0
- data/spec/webbynode/git_spec.rb +310 -0
- data/spec/webbynode/io_spec.rb +198 -0
- data/spec/webbynode/option_spec.rb +48 -0
- data/spec/webbynode/parameter_spec.rb +70 -0
- data/spec/webbynode/push_and_spec.rb +28 -0
- data/spec/webbynode/remote_executor_spec.rb +25 -0
- data/spec/webbynode/server_spec.rb +101 -0
- data/webbynode.gemspec +25 -16
- metadata +182 -14
- data/lib/wn.rb +0 -106
- data/test/test_helper.rb +0 -9
- data/test/test_wn.rb +0 -220
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Load Spec Helper
|
|
2
|
+
require File.join(File.expand_path(File.dirname(__FILE__)), '..', 'spec_helper')
|
|
3
|
+
|
|
4
|
+
describe Webbynode::Server do
|
|
5
|
+
it "should have an Io instance" do
|
|
6
|
+
Webbynode::Server.new("1.2.3.4").io.class.should == Webbynode::Io
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should have a RemoteExecutor instance" do
|
|
10
|
+
Webbynode::Server.new("1.2.3.4").remote_executor.class.should == Webbynode::RemoteExecutor
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
describe "#add_ssh_key" do
|
|
14
|
+
before(:each) do
|
|
15
|
+
@io = mock("Io")
|
|
16
|
+
@io.as_null_object
|
|
17
|
+
|
|
18
|
+
@re = mock("RemoteExecutor")
|
|
19
|
+
@re.as_null_object
|
|
20
|
+
|
|
21
|
+
@pushand = mock("PushAnd")
|
|
22
|
+
@pushand.as_null_object
|
|
23
|
+
|
|
24
|
+
@server = Webbynode::Server.new("1.2.3.4")
|
|
25
|
+
@server.should_receive(:io).any_number_of_times.and_return(@io)
|
|
26
|
+
@server.should_receive(:remote_executor).any_number_of_times.and_return(@re)
|
|
27
|
+
@server.should_receive(:pushand).any_number_of_times.and_return(@pushand)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe "which local key missing" do
|
|
31
|
+
context "when unsuccessful" do
|
|
32
|
+
it "should create a local SSH key with empty passphrase" do
|
|
33
|
+
@io.should_receive(:file_exists?).with("xyz").and_return(false)
|
|
34
|
+
@io.should_receive(:create_local_key).with("xyz", "")
|
|
35
|
+
|
|
36
|
+
@server.add_ssh_key "xyz"
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
it "should create a local SSH key with the provided passphrase" do
|
|
40
|
+
@io.should_receive(:file_exists?).with("abc").and_return(false)
|
|
41
|
+
@io.should_receive(:create_local_key).with("abc", "my_passphrase")
|
|
42
|
+
|
|
43
|
+
@server.add_ssh_key "abc", "my_passphrase"
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
context "when unsuccessful" do
|
|
48
|
+
it "should raise a PermissionError if cannot write the key" do
|
|
49
|
+
@io.should_receive(:file_exists?).with("xyz").and_return(false)
|
|
50
|
+
@io.should_receive(:create_local_key).and_raise(Webbynode::PermissionError)
|
|
51
|
+
|
|
52
|
+
lambda { @server.add_ssh_key "xyz" }.should raise_error(Webbynode::PermissionError)
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
describe "with local key present" do
|
|
58
|
+
context "when successful" do
|
|
59
|
+
it "should not create a local key" do
|
|
60
|
+
@io.should_receive(:file_exists?).with("xyz").and_return(true)
|
|
61
|
+
@io.should_receive(:create_local_key).never()
|
|
62
|
+
|
|
63
|
+
@server.add_ssh_key "xyz"
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
it "should create the SSH folder on the server" do
|
|
67
|
+
@re.should_receive(:create_folder).with("~/.ssh")
|
|
68
|
+
@server.add_ssh_key "abc"
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
it "should upload the local key to the server" do
|
|
72
|
+
@io.should_receive(:read_file).with("abc").and_return("key_contents")
|
|
73
|
+
@re.should_receive(:exec).with('echo "key_contents" >> ~/.ssh/authorized_keys; chmod 644 ~/.ssh/authorized_keys')
|
|
74
|
+
|
|
75
|
+
@server.add_ssh_key "abc"
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
describe "#application_pushed?" do
|
|
81
|
+
context "when successful" do
|
|
82
|
+
it "should check if the application has been pushed" do
|
|
83
|
+
@pushand.should_receive(:parse_remote_app_name).and_return('test.webbynode.com')
|
|
84
|
+
@re.should_receive(:exec).with("cd test.webbynode.com")
|
|
85
|
+
@server.application_pushed?
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
context "when unsuccessful" do
|
|
90
|
+
it "should check if the application has been pushed" do
|
|
91
|
+
@pushand.should_receive(:parse_remote_app_name).and_return('test.webbynode.com')
|
|
92
|
+
error_message = "bash: line 0: cd: test.webbynode.com: No such file or directory"
|
|
93
|
+
@re.should_receive(:exec).with("cd test.webbynode.com").and_return(error_message)
|
|
94
|
+
error_message.should =~ /No such file or directory/
|
|
95
|
+
@server.application_pushed?
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
end
|
|
101
|
+
end
|
data/webbynode.gemspec
CHANGED
|
@@ -2,29 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |s|
|
|
4
4
|
s.name = %q{webbynode}
|
|
5
|
-
s.version = "0.
|
|
5
|
+
s.version = "0.2.0"
|
|
6
6
|
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
|
8
8
|
s.authors = ["Felipe Coury"]
|
|
9
|
-
s.date = %q{2010-
|
|
10
|
-
s.default_executable = %q{webbynode}
|
|
9
|
+
s.date = %q{2010-02-16}
|
|
11
10
|
s.description = %q{Webbynode Deployment Gem}
|
|
12
11
|
s.email = %q{felipe@webbynode.com}
|
|
13
|
-
s.executables = ["webbynode"]
|
|
14
|
-
s.extra_rdoc_files = ["README.rdoc", "bin/webbynode", "lib/
|
|
15
|
-
s.files = ["History.txt", "Manifest", "Manifest.txt", "PostInstall.txt", "README.rdoc", "Rakefile", "bin/webbynode", "
|
|
12
|
+
s.executables = ["webbynode", "wn"]
|
|
13
|
+
s.extra_rdoc_files = ["README.rdoc", "bin/webbynode", "bin/wn", "lib/templates/api_token", "lib/templates/backup", "lib/templates/gitignore", "lib/templates/help", "lib/webbynode.rb", "lib/webbynode/api_client.rb", "lib/webbynode/application.rb", "lib/webbynode/command.rb", "lib/webbynode/commands/add_backup.rb", "lib/webbynode/commands/add_key.rb", "lib/webbynode/commands/alias.rb", "lib/webbynode/commands/change_dns.rb", "lib/webbynode/commands/config.rb", "lib/webbynode/commands/delete.rb", "lib/webbynode/commands/help.rb", "lib/webbynode/commands/init.rb", "lib/webbynode/commands/push.rb", "lib/webbynode/commands/remote.rb", "lib/webbynode/commands/restart.rb", "lib/webbynode/commands/start.rb", "lib/webbynode/commands/stop.rb", "lib/webbynode/commands/tasks.rb", "lib/webbynode/commands/version.rb", "lib/webbynode/commands/webbies.rb", "lib/webbynode/git.rb", "lib/webbynode/io.rb", "lib/webbynode/notify.rb", "lib/webbynode/option.rb", "lib/webbynode/parameter.rb", "lib/webbynode/properties.rb", "lib/webbynode/push_and.rb", "lib/webbynode/remote_executor.rb", "lib/webbynode/server.rb", "lib/webbynode/ssh.rb", "lib/webbynode/ssh_keys.rb"]
|
|
14
|
+
s.files = ["History.txt", "Manifest", "Manifest.txt", "PostInstall.txt", "README.rdoc", "Rakefile", "assets/webbynode.png", "bin/webbynode", "bin/wn", "cucumber.yml", "devver.rake", "features/bootstrap.feature", "features/step_definitions/command_steps.rb", "features/support/env.rb", "features/support/hooks.rb", "features/support/io_features.rb", "features/support/mocha.rb", "lib/templates/api_token", "lib/templates/backup", "lib/templates/gitignore", "lib/templates/help", "lib/webbynode.rb", "lib/webbynode/api_client.rb", "lib/webbynode/application.rb", "lib/webbynode/command.rb", "lib/webbynode/commands/add_backup.rb", "lib/webbynode/commands/add_key.rb", "lib/webbynode/commands/alias.rb", "lib/webbynode/commands/change_dns.rb", "lib/webbynode/commands/config.rb", "lib/webbynode/commands/delete.rb", "lib/webbynode/commands/help.rb", "lib/webbynode/commands/init.rb", "lib/webbynode/commands/push.rb", "lib/webbynode/commands/remote.rb", "lib/webbynode/commands/restart.rb", "lib/webbynode/commands/start.rb", "lib/webbynode/commands/stop.rb", "lib/webbynode/commands/tasks.rb", "lib/webbynode/commands/version.rb", "lib/webbynode/commands/webbies.rb", "lib/webbynode/git.rb", "lib/webbynode/io.rb", "lib/webbynode/notify.rb", "lib/webbynode/option.rb", "lib/webbynode/parameter.rb", "lib/webbynode/properties.rb", "lib/webbynode/push_and.rb", "lib/webbynode/remote_executor.rb", "lib/webbynode/server.rb", "lib/webbynode/ssh.rb", "lib/webbynode/ssh_keys.rb", "spec/fixtures/aliases", "spec/fixtures/api/credentials", "spec/fixtures/api/dns", "spec/fixtures/api/dns_a_record", "spec/fixtures/api/dns_a_record_already_exists", "spec/fixtures/api/dns_a_record_error", "spec/fixtures/api/dns_new_zone", "spec/fixtures/api/webbies", "spec/fixtures/api/webbies_unauthorized", "spec/fixtures/api/webby", "spec/fixtures/commands/tasks/after_push", "spec/fixtures/fixture_helpers", "spec/fixtures/git/config/210.11.13.12", "spec/fixtures/git/config/67.23.79.31", "spec/fixtures/git/config/67.23.79.32", "spec/fixtures/git/config/config", "spec/fixtures/git/status/clean", "spec/fixtures/git/status/dirty", "spec/fixtures/pushand", "spec/spec_helper.rb", "spec/webbynode/api_client_spec.rb", "spec/webbynode/application_spec.rb", "spec/webbynode/command_spec.rb", "spec/webbynode/commands/add_backup_spec.rb", "spec/webbynode/commands/add_key_spec.rb", "spec/webbynode/commands/alias_spec.rb", "spec/webbynode/commands/change_dns_spec.rb", "spec/webbynode/commands/config_spec.rb", "spec/webbynode/commands/delete_spec.rb", "spec/webbynode/commands/help_spec.rb", "spec/webbynode/commands/init_spec.rb", "spec/webbynode/commands/push_spec.rb", "spec/webbynode/commands/remote_spec.rb", "spec/webbynode/commands/tasks_spec.rb", "spec/webbynode/commands/version_spec.rb", "spec/webbynode/commands/webbies_spec.rb", "spec/webbynode/git_spec.rb", "spec/webbynode/io_spec.rb", "spec/webbynode/option_spec.rb", "spec/webbynode/parameter_spec.rb", "spec/webbynode/push_and_spec.rb", "spec/webbynode/remote_executor_spec.rb", "spec/webbynode/server_spec.rb", "webbynode.gemspec"]
|
|
16
15
|
s.homepage = %q{http://webbynode.com}
|
|
17
|
-
s.post_install_message = %q{
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
s.post_install_message = %q{
|
|
17
|
+
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
18
|
+
Webbynode Rapid Deployment Gem
|
|
19
|
+
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
This deployment engine is highly experimental and
|
|
22
|
+
should be considered beta code for now.
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
webbynode init Initializes the current app for deployment to a Webby
|
|
27
|
-
webbynode push Deploys the current committed code to a Webby
|
|
24
|
+
For a quickstart:
|
|
25
|
+
http://guides.webbynode.com/articles/rapidapps
|
|
28
26
|
|
|
29
27
|
}
|
|
30
28
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Webbynode", "--main", "README.rdoc"]
|
|
@@ -32,15 +30,26 @@ Gem::Specification.new do |s|
|
|
|
32
30
|
s.rubyforge_project = %q{webbynode}
|
|
33
31
|
s.rubygems_version = %q{1.3.5}
|
|
34
32
|
s.summary = %q{Webbynode Deployment Gem}
|
|
35
|
-
s.test_files = ["test/test_helper.rb", "test/test_webbynode.rb", "test/test_wn.rb"]
|
|
36
33
|
|
|
37
34
|
if s.respond_to? :specification_version then
|
|
38
35
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
|
39
36
|
s.specification_version = 3
|
|
40
37
|
|
|
41
38
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
|
39
|
+
s.add_runtime_dependency(%q<net-ssh>, [">= 2.0.20"])
|
|
40
|
+
s.add_runtime_dependency(%q<highline>, [">= 1.5.2"])
|
|
41
|
+
s.add_runtime_dependency(%q<httparty>, [">= 0.4.5"])
|
|
42
|
+
s.add_runtime_dependency(%q<domainatrix>, [">= 0.0.7"])
|
|
42
43
|
else
|
|
44
|
+
s.add_dependency(%q<net-ssh>, [">= 2.0.20"])
|
|
45
|
+
s.add_dependency(%q<highline>, [">= 1.5.2"])
|
|
46
|
+
s.add_dependency(%q<httparty>, [">= 0.4.5"])
|
|
47
|
+
s.add_dependency(%q<domainatrix>, [">= 0.0.7"])
|
|
43
48
|
end
|
|
44
49
|
else
|
|
50
|
+
s.add_dependency(%q<net-ssh>, [">= 2.0.20"])
|
|
51
|
+
s.add_dependency(%q<highline>, [">= 1.5.2"])
|
|
52
|
+
s.add_dependency(%q<httparty>, [">= 0.4.5"])
|
|
53
|
+
s.add_dependency(%q<domainatrix>, [">= 0.0.7"])
|
|
45
54
|
end
|
|
46
55
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: webbynode
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Felipe Coury
|
|
@@ -9,20 +9,95 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2010-
|
|
12
|
+
date: 2010-02-16 00:00:00 -02:00
|
|
13
13
|
default_executable:
|
|
14
|
-
dependencies:
|
|
15
|
-
|
|
14
|
+
dependencies:
|
|
15
|
+
- !ruby/object:Gem::Dependency
|
|
16
|
+
name: net-ssh
|
|
17
|
+
type: :runtime
|
|
18
|
+
version_requirement:
|
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
20
|
+
requirements:
|
|
21
|
+
- - ">="
|
|
22
|
+
- !ruby/object:Gem::Version
|
|
23
|
+
version: 2.0.20
|
|
24
|
+
version:
|
|
25
|
+
- !ruby/object:Gem::Dependency
|
|
26
|
+
name: highline
|
|
27
|
+
type: :runtime
|
|
28
|
+
version_requirement:
|
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: 1.5.2
|
|
34
|
+
version:
|
|
35
|
+
- !ruby/object:Gem::Dependency
|
|
36
|
+
name: httparty
|
|
37
|
+
type: :runtime
|
|
38
|
+
version_requirement:
|
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
40
|
+
requirements:
|
|
41
|
+
- - ">="
|
|
42
|
+
- !ruby/object:Gem::Version
|
|
43
|
+
version: 0.4.5
|
|
44
|
+
version:
|
|
45
|
+
- !ruby/object:Gem::Dependency
|
|
46
|
+
name: domainatrix
|
|
47
|
+
type: :runtime
|
|
48
|
+
version_requirement:
|
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: 0.0.7
|
|
54
|
+
version:
|
|
16
55
|
description: Webbynode Deployment Gem
|
|
17
56
|
email: felipe@webbynode.com
|
|
18
57
|
executables:
|
|
19
58
|
- webbynode
|
|
59
|
+
- wn
|
|
20
60
|
extensions: []
|
|
21
61
|
|
|
22
62
|
extra_rdoc_files:
|
|
23
63
|
- README.rdoc
|
|
24
64
|
- bin/webbynode
|
|
25
|
-
-
|
|
65
|
+
- bin/wn
|
|
66
|
+
- lib/templates/api_token
|
|
67
|
+
- lib/templates/backup
|
|
68
|
+
- lib/templates/gitignore
|
|
69
|
+
- lib/templates/help
|
|
70
|
+
- lib/webbynode.rb
|
|
71
|
+
- lib/webbynode/api_client.rb
|
|
72
|
+
- lib/webbynode/application.rb
|
|
73
|
+
- lib/webbynode/command.rb
|
|
74
|
+
- lib/webbynode/commands/add_backup.rb
|
|
75
|
+
- lib/webbynode/commands/add_key.rb
|
|
76
|
+
- lib/webbynode/commands/alias.rb
|
|
77
|
+
- lib/webbynode/commands/change_dns.rb
|
|
78
|
+
- lib/webbynode/commands/config.rb
|
|
79
|
+
- lib/webbynode/commands/delete.rb
|
|
80
|
+
- lib/webbynode/commands/help.rb
|
|
81
|
+
- lib/webbynode/commands/init.rb
|
|
82
|
+
- lib/webbynode/commands/push.rb
|
|
83
|
+
- lib/webbynode/commands/remote.rb
|
|
84
|
+
- lib/webbynode/commands/restart.rb
|
|
85
|
+
- lib/webbynode/commands/start.rb
|
|
86
|
+
- lib/webbynode/commands/stop.rb
|
|
87
|
+
- lib/webbynode/commands/tasks.rb
|
|
88
|
+
- lib/webbynode/commands/version.rb
|
|
89
|
+
- lib/webbynode/commands/webbies.rb
|
|
90
|
+
- lib/webbynode/git.rb
|
|
91
|
+
- lib/webbynode/io.rb
|
|
92
|
+
- lib/webbynode/notify.rb
|
|
93
|
+
- lib/webbynode/option.rb
|
|
94
|
+
- lib/webbynode/parameter.rb
|
|
95
|
+
- lib/webbynode/properties.rb
|
|
96
|
+
- lib/webbynode/push_and.rb
|
|
97
|
+
- lib/webbynode/remote_executor.rb
|
|
98
|
+
- lib/webbynode/server.rb
|
|
99
|
+
- lib/webbynode/ssh.rb
|
|
100
|
+
- lib/webbynode/ssh_keys.rb
|
|
26
101
|
files:
|
|
27
102
|
- History.txt
|
|
28
103
|
- Manifest
|
|
@@ -30,17 +105,112 @@ files:
|
|
|
30
105
|
- PostInstall.txt
|
|
31
106
|
- README.rdoc
|
|
32
107
|
- Rakefile
|
|
108
|
+
- assets/webbynode.png
|
|
33
109
|
- bin/webbynode
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
110
|
+
- bin/wn
|
|
111
|
+
- cucumber.yml
|
|
112
|
+
- devver.rake
|
|
113
|
+
- features/bootstrap.feature
|
|
114
|
+
- features/step_definitions/command_steps.rb
|
|
115
|
+
- features/support/env.rb
|
|
116
|
+
- features/support/hooks.rb
|
|
117
|
+
- features/support/io_features.rb
|
|
118
|
+
- features/support/mocha.rb
|
|
119
|
+
- lib/templates/api_token
|
|
120
|
+
- lib/templates/backup
|
|
121
|
+
- lib/templates/gitignore
|
|
122
|
+
- lib/templates/help
|
|
123
|
+
- lib/webbynode.rb
|
|
124
|
+
- lib/webbynode/api_client.rb
|
|
125
|
+
- lib/webbynode/application.rb
|
|
126
|
+
- lib/webbynode/command.rb
|
|
127
|
+
- lib/webbynode/commands/add_backup.rb
|
|
128
|
+
- lib/webbynode/commands/add_key.rb
|
|
129
|
+
- lib/webbynode/commands/alias.rb
|
|
130
|
+
- lib/webbynode/commands/change_dns.rb
|
|
131
|
+
- lib/webbynode/commands/config.rb
|
|
132
|
+
- lib/webbynode/commands/delete.rb
|
|
133
|
+
- lib/webbynode/commands/help.rb
|
|
134
|
+
- lib/webbynode/commands/init.rb
|
|
135
|
+
- lib/webbynode/commands/push.rb
|
|
136
|
+
- lib/webbynode/commands/remote.rb
|
|
137
|
+
- lib/webbynode/commands/restart.rb
|
|
138
|
+
- lib/webbynode/commands/start.rb
|
|
139
|
+
- lib/webbynode/commands/stop.rb
|
|
140
|
+
- lib/webbynode/commands/tasks.rb
|
|
141
|
+
- lib/webbynode/commands/version.rb
|
|
142
|
+
- lib/webbynode/commands/webbies.rb
|
|
143
|
+
- lib/webbynode/git.rb
|
|
144
|
+
- lib/webbynode/io.rb
|
|
145
|
+
- lib/webbynode/notify.rb
|
|
146
|
+
- lib/webbynode/option.rb
|
|
147
|
+
- lib/webbynode/parameter.rb
|
|
148
|
+
- lib/webbynode/properties.rb
|
|
149
|
+
- lib/webbynode/push_and.rb
|
|
150
|
+
- lib/webbynode/remote_executor.rb
|
|
151
|
+
- lib/webbynode/server.rb
|
|
152
|
+
- lib/webbynode/ssh.rb
|
|
153
|
+
- lib/webbynode/ssh_keys.rb
|
|
154
|
+
- spec/fixtures/aliases
|
|
155
|
+
- spec/fixtures/api/credentials
|
|
156
|
+
- spec/fixtures/api/dns
|
|
157
|
+
- spec/fixtures/api/dns_a_record
|
|
158
|
+
- spec/fixtures/api/dns_a_record_already_exists
|
|
159
|
+
- spec/fixtures/api/dns_a_record_error
|
|
160
|
+
- spec/fixtures/api/dns_new_zone
|
|
161
|
+
- spec/fixtures/api/webbies
|
|
162
|
+
- spec/fixtures/api/webbies_unauthorized
|
|
163
|
+
- spec/fixtures/api/webby
|
|
164
|
+
- spec/fixtures/commands/tasks/after_push
|
|
165
|
+
- spec/fixtures/fixture_helpers
|
|
166
|
+
- spec/fixtures/git/config/210.11.13.12
|
|
167
|
+
- spec/fixtures/git/config/67.23.79.31
|
|
168
|
+
- spec/fixtures/git/config/67.23.79.32
|
|
169
|
+
- spec/fixtures/git/config/config
|
|
170
|
+
- spec/fixtures/git/status/clean
|
|
171
|
+
- spec/fixtures/git/status/dirty
|
|
172
|
+
- spec/fixtures/pushand
|
|
173
|
+
- spec/spec_helper.rb
|
|
174
|
+
- spec/webbynode/api_client_spec.rb
|
|
175
|
+
- spec/webbynode/application_spec.rb
|
|
176
|
+
- spec/webbynode/command_spec.rb
|
|
177
|
+
- spec/webbynode/commands/add_backup_spec.rb
|
|
178
|
+
- spec/webbynode/commands/add_key_spec.rb
|
|
179
|
+
- spec/webbynode/commands/alias_spec.rb
|
|
180
|
+
- spec/webbynode/commands/change_dns_spec.rb
|
|
181
|
+
- spec/webbynode/commands/config_spec.rb
|
|
182
|
+
- spec/webbynode/commands/delete_spec.rb
|
|
183
|
+
- spec/webbynode/commands/help_spec.rb
|
|
184
|
+
- spec/webbynode/commands/init_spec.rb
|
|
185
|
+
- spec/webbynode/commands/push_spec.rb
|
|
186
|
+
- spec/webbynode/commands/remote_spec.rb
|
|
187
|
+
- spec/webbynode/commands/tasks_spec.rb
|
|
188
|
+
- spec/webbynode/commands/version_spec.rb
|
|
189
|
+
- spec/webbynode/commands/webbies_spec.rb
|
|
190
|
+
- spec/webbynode/git_spec.rb
|
|
191
|
+
- spec/webbynode/io_spec.rb
|
|
192
|
+
- spec/webbynode/option_spec.rb
|
|
193
|
+
- spec/webbynode/parameter_spec.rb
|
|
194
|
+
- spec/webbynode/push_and_spec.rb
|
|
195
|
+
- spec/webbynode/remote_executor_spec.rb
|
|
196
|
+
- spec/webbynode/server_spec.rb
|
|
38
197
|
- webbynode.gemspec
|
|
39
198
|
has_rdoc: true
|
|
40
199
|
homepage: http://webbynode.com
|
|
41
200
|
licenses: []
|
|
42
201
|
|
|
43
|
-
post_install_message:
|
|
202
|
+
post_install_message: |+
|
|
203
|
+
|
|
204
|
+
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
205
|
+
Webbynode Rapid Deployment Gem
|
|
206
|
+
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
207
|
+
|
|
208
|
+
This deployment engine is highly experimental and
|
|
209
|
+
should be considered beta code for now.
|
|
210
|
+
|
|
211
|
+
For a quickstart:
|
|
212
|
+
http://guides.webbynode.com/articles/rapidapps
|
|
213
|
+
|
|
44
214
|
rdoc_options:
|
|
45
215
|
- --line-numbers
|
|
46
216
|
- --inline-source
|
|
@@ -69,7 +239,5 @@ rubygems_version: 1.3.5
|
|
|
69
239
|
signing_key:
|
|
70
240
|
specification_version: 3
|
|
71
241
|
summary: Webbynode Deployment Gem
|
|
72
|
-
test_files:
|
|
73
|
-
|
|
74
|
-
- test/test_webbynode.rb
|
|
75
|
-
- test/test_wn.rb
|
|
242
|
+
test_files: []
|
|
243
|
+
|
data/lib/wn.rb
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
$:.unshift(File.dirname(__FILE__)) unless
|
|
2
|
-
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
|
3
|
-
|
|
4
|
-
require 'pp'
|
|
5
|
-
|
|
6
|
-
module Wn
|
|
7
|
-
VERSION = '0.0.1'
|
|
8
|
-
|
|
9
|
-
class App
|
|
10
|
-
attr_accessor :command
|
|
11
|
-
attr_accessor :params
|
|
12
|
-
|
|
13
|
-
def initialize(command)
|
|
14
|
-
parse command
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
def run
|
|
18
|
-
send command
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def parse(parts)
|
|
22
|
-
@command = parts.shift
|
|
23
|
-
@params = parts
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def push
|
|
27
|
-
unless dir_exists(".git")
|
|
28
|
-
out "Not an application or missing initialization. Use 'webbynode init'."
|
|
29
|
-
return
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
out "Publishing #{app_name} to Webbynode..."
|
|
33
|
-
sys_exec "git push webbynode master"
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def init
|
|
37
|
-
if params.size < 1
|
|
38
|
-
out "usage: webbynode init webby_ip [host]"
|
|
39
|
-
return
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
webby_ip, host = *params
|
|
43
|
-
host = app_name unless host
|
|
44
|
-
|
|
45
|
-
unless file_exists(".pushand")
|
|
46
|
-
out "Initializing deployment descriptor for #{host}..."
|
|
47
|
-
create_file ".pushand", "#! /bin/bash\nphd $0 #{host}\n"
|
|
48
|
-
sys_exec "chmod +x .pushand"
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
unless file_exists(".gitignore")
|
|
52
|
-
out "Creating .gitignore file..."
|
|
53
|
-
create_file ".gitignore", <<EOS
|
|
54
|
-
config/database.yml
|
|
55
|
-
log/*
|
|
56
|
-
tmp/*
|
|
57
|
-
db/*.sqlite3
|
|
58
|
-
EOS
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
if dir_exists(".git")
|
|
62
|
-
out "Adding Webbynode remote host to git..."
|
|
63
|
-
else
|
|
64
|
-
out "Initializing git repository..."
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
git_init webby_ip
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
def git_init(ip)
|
|
71
|
-
sys_exec "git init" unless dir_exists(".git")
|
|
72
|
-
|
|
73
|
-
sys_exec "git remote add webbynode git@#{ip}:#{app_name}"
|
|
74
|
-
|
|
75
|
-
sys_exec "git add ."
|
|
76
|
-
sys_exec "git commit -m \"Initial commit\""
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
def app_name
|
|
80
|
-
Dir.pwd.split("/").last.gsub(/\./, "_")
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
def dir_exists(dir)
|
|
84
|
-
File.directory?(dir)
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
def out(line)
|
|
88
|
-
puts line
|
|
89
|
-
end
|
|
90
|
-
|
|
91
|
-
def file_exists(file)
|
|
92
|
-
File.exists?(file)
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
def create_file(filename, contents)
|
|
96
|
-
File.open(filename, "w") do |file|
|
|
97
|
-
file.write(contents)
|
|
98
|
-
end
|
|
99
|
-
end
|
|
100
|
-
|
|
101
|
-
def sys_exec(cmd)
|
|
102
|
-
raise "Tried to run: #{cmd}" if $testing
|
|
103
|
-
`#{cmd}`
|
|
104
|
-
end
|
|
105
|
-
end
|
|
106
|
-
end
|