webbynode 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of webbynode might be problematic. Click here for more details.
- data/History.txt +4 -0
- data/Manifest +12 -0
- data/Manifest.txt +11 -0
- data/PostInstall.txt +12 -0
- data/README.rdoc +132 -0
- data/Rakefile +55 -0
- data/bin/webbynode +7 -0
- data/lib/wn.rb +106 -0
- data/oldRakefile +26 -0
- data/test/test_helper.rb +8 -0
- data/test/test_webbynode.rb +0 -0
- data/test/test_wn.rb +204 -0
- data/webbynode.gemspec +46 -0
- metadata +76 -0
data/History.txt
ADDED
data/Manifest
ADDED
data/Manifest.txt
ADDED
data/PostInstall.txt
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
2
|
+
Webbynode deployment gem
|
3
|
+
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
4
|
+
|
5
|
+
This deployment engine is highly experimental and
|
6
|
+
should be considered beta code for now.
|
7
|
+
|
8
|
+
Commands:
|
9
|
+
|
10
|
+
webbynode init Initializes the current app for deployment to a Webby
|
11
|
+
webbynode push Deploys the current committed code to a Webby
|
12
|
+
|
data/README.rdoc
ADDED
@@ -0,0 +1,132 @@
|
|
1
|
+
= Webbynode Gem
|
2
|
+
|
3
|
+
Available on GitHub and installable from Gemcutter.
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
Automates Rails or Rack application deployment using Webbynode Rapid App Deployment.
|
8
|
+
|
9
|
+
== FEATURES/PROBLEMS:
|
10
|
+
|
11
|
+
* From zero to production with two commands;
|
12
|
+
* Super easy updates;
|
13
|
+
|
14
|
+
== SYNOPSIS:
|
15
|
+
|
16
|
+
$ rails app
|
17
|
+
create
|
18
|
+
create app/controllers
|
19
|
+
create app/helpers
|
20
|
+
create app/models
|
21
|
+
(...)
|
22
|
+
|
23
|
+
$ cd myapp
|
24
|
+
$ webbynode init 200.120.123.123 myapp.com
|
25
|
+
Initializing deployment descriptor for myapp.com...
|
26
|
+
Creating .gitignore file...
|
27
|
+
Initializing git repository...
|
28
|
+
|
29
|
+
$ webbynode push
|
30
|
+
Publishing myapp to Webbynode...
|
31
|
+
git@200.120.123.123's password:
|
32
|
+
mkdir: created directory `myapp'
|
33
|
+
Counting objects: 62, done.
|
34
|
+
Delta compression using up to 2 threads.
|
35
|
+
Compressing objects: 100% (53/53), done.
|
36
|
+
Writing objects: 100% (62/62), 79.14 KiB, done.
|
37
|
+
Total 62 (delta 10), reused 0 (delta 0)
|
38
|
+
Checked out master branch
|
39
|
+
|
40
|
+
----------------------------
|
41
|
+
Webbynode git deployment
|
42
|
+
----------------------------
|
43
|
+
|
44
|
+
Deploying application myapp as myapp.com...
|
45
|
+
Configuring Rails application...
|
46
|
+
=> Configuring apache vHost...
|
47
|
+
=> Configuring database...
|
48
|
+
=> Configuring database.yml...
|
49
|
+
=> Installing missing gems...
|
50
|
+
=> Migrating database...
|
51
|
+
/var/rails/myapp/.git
|
52
|
+
|
53
|
+
Restarting apache...
|
54
|
+
|
55
|
+
myapp deployed successfully.
|
56
|
+
|
57
|
+
To git@208.88.125.207:myapp
|
58
|
+
* [new branch] master -> master
|
59
|
+
|
60
|
+
And that's it, just visit myapp.com (considering DNS is working) and you should have your Rails app displayed.
|
61
|
+
|
62
|
+
Then to update:
|
63
|
+
|
64
|
+
$ script/generate scaffold user name:string age:integer password:string
|
65
|
+
exists app/models/
|
66
|
+
exists app/controllers/
|
67
|
+
exists app/helpers/
|
68
|
+
create app/views/users
|
69
|
+
exists app/views/layouts/
|
70
|
+
exists test/functional/
|
71
|
+
exists test/unit/
|
72
|
+
create test/unit/helpers/
|
73
|
+
exists public/stylesheets/
|
74
|
+
create app/views/users/index.html.erb
|
75
|
+
(...)
|
76
|
+
|
77
|
+
$ git add .
|
78
|
+
|
79
|
+
$ git commit -m "Added users"
|
80
|
+
[master a607460] Added users
|
81
|
+
15 files changed, 334 insertions(+), 0 deletions(-)
|
82
|
+
create mode 100644 app/controllers/users_controller.rb
|
83
|
+
create mode 100644 app/helpers/users_helper.rb
|
84
|
+
create mode 100644 app/models/user.rb
|
85
|
+
(...)
|
86
|
+
|
87
|
+
$ webbynode push
|
88
|
+
Publishing myapp to Webbynode...
|
89
|
+
git@208.88.125.207's password:
|
90
|
+
Counting objects: 43, done.
|
91
|
+
(...)
|
92
|
+
Restarting apache...
|
93
|
+
|
94
|
+
myapp deployed successfully.
|
95
|
+
|
96
|
+
To git@208.88.125.207:myapp
|
97
|
+
2355220..a607460 master -> master
|
98
|
+
|
99
|
+
== REQUIREMENTS:
|
100
|
+
|
101
|
+
* Requires, obviously, a Webbynode account
|
102
|
+
* Webby server deployed with Rapid Deployment option
|
103
|
+
* Only works for Apache with Passenger (Nginx and Passenger on the works)
|
104
|
+
|
105
|
+
== INSTALL:
|
106
|
+
|
107
|
+
sudo gem install webbynode
|
108
|
+
|
109
|
+
== LICENSE:
|
110
|
+
|
111
|
+
(The MIT License)
|
112
|
+
|
113
|
+
Copyright (c) 2010 FIXME full name
|
114
|
+
|
115
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
116
|
+
a copy of this software and associated documentation files (the
|
117
|
+
'Software'), to deal in the Software without restriction, including
|
118
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
119
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
120
|
+
permit persons to whom the Software is furnished to do so, subject to
|
121
|
+
the following conditions:
|
122
|
+
|
123
|
+
The above copyright notice and this permission notice shall be
|
124
|
+
included in all copies or substantial portions of the Software.
|
125
|
+
|
126
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
127
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
128
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
129
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
130
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
131
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
132
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'rake/testtask'
|
4
|
+
|
5
|
+
require 'echoe'
|
6
|
+
|
7
|
+
Echoe.new('webbynode', '0.1.0') do |p|
|
8
|
+
p.description = "Webbynode Deployment Gem"
|
9
|
+
p.url = "http://webbynode.com"
|
10
|
+
p.author = "Felipe Coury"
|
11
|
+
p.email = "felipe@webbynode.com"
|
12
|
+
p.ignore_pattern = ["tmp/*", "script/*"]
|
13
|
+
# p.dependencies = [
|
14
|
+
# ['activeresource','>= 2.3.4'],
|
15
|
+
# ['activesupport','>= 2.3.4'],
|
16
|
+
# ['rainbow', '>=1.0.4'],
|
17
|
+
# ['highline', '>=1.5.1'],
|
18
|
+
# ['httparty', '>=0.4.5']
|
19
|
+
# ]
|
20
|
+
p.install_message = <<EOS
|
21
|
+
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
22
|
+
Webbynode deployment gem
|
23
|
+
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
24
|
+
|
25
|
+
This deployment engine is highly experimental and
|
26
|
+
should be considered beta code for the time being.
|
27
|
+
|
28
|
+
Commands:
|
29
|
+
|
30
|
+
webbynode init Initializes the current app for deployment to a Webby
|
31
|
+
webbynode push Deploys the current committed code to a Webby
|
32
|
+
|
33
|
+
EOS
|
34
|
+
end
|
35
|
+
#
|
36
|
+
# Rake::TestTask.new(:test_new) do |test|
|
37
|
+
# test.libs << 'test'
|
38
|
+
# test.ruby_opts << '-rubygems'
|
39
|
+
# test.pattern = 'test/**/test_*.rb'
|
40
|
+
# test.verbose = true
|
41
|
+
# end
|
42
|
+
|
43
|
+
require 'rcov/rcovtask'
|
44
|
+
desc 'Measures test coverage using rcov'
|
45
|
+
namespace :rcov do
|
46
|
+
desc 'Output unit test coverage of plugin.'
|
47
|
+
Rcov::RcovTask.new(:unit) do |rcov|
|
48
|
+
rcov.libs << 'test'
|
49
|
+
rcov.ruby_opts << '-rubygems'
|
50
|
+
rcov.pattern = 'test/unit/**/test_*.rb'
|
51
|
+
rcov.output_dir = 'rcov'
|
52
|
+
rcov.verbose = true
|
53
|
+
rcov.rcov_opts << '--exclude "gems/*"'
|
54
|
+
end
|
55
|
+
end
|
data/bin/webbynode
ADDED
data/lib/wn.rb
ADDED
@@ -0,0 +1,106 @@
|
|
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: wn 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
|
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
|
data/oldRakefile
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
gem 'hoe', '>= 2.1.0'
|
3
|
+
require 'hoe'
|
4
|
+
require 'fileutils'
|
5
|
+
require './lib/wn'
|
6
|
+
|
7
|
+
Hoe.plugin :newgem
|
8
|
+
# Hoe.plugin :website
|
9
|
+
# Hoe.plugin :cucumberfeatures
|
10
|
+
|
11
|
+
# Generate all the Rake tasks
|
12
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
13
|
+
$hoe = Hoe.spec 'wn' do
|
14
|
+
self.developer 'Felipe Coury', 'felipe@webbynode.com'
|
15
|
+
self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
|
16
|
+
self.rubyforge_name = self.name # TODO this is default value
|
17
|
+
# self.extra_deps = [['activesupport','>= 2.0.2']]
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
require 'newgem/tasks'
|
22
|
+
Dir['tasks/**/*.rake'].each { |t| load t }
|
23
|
+
|
24
|
+
# TODO - want other tests/tasks run by default? Add them to the list
|
25
|
+
# remove_task :default
|
26
|
+
# task :default => [:spec, :features]
|
data/test/test_helper.rb
ADDED
File without changes
|
data/test/test_wn.rb
ADDED
@@ -0,0 +1,204 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
+
|
3
|
+
class TestWn < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def command(s)
|
6
|
+
Wn::App.new(s.split(" "))
|
7
|
+
end
|
8
|
+
|
9
|
+
context "Parsing commands" do
|
10
|
+
should "trigger the proper method" do
|
11
|
+
app = command("init")
|
12
|
+
app.expects(:init)
|
13
|
+
app.run
|
14
|
+
|
15
|
+
app = command("push")
|
16
|
+
app.expects(:push)
|
17
|
+
app.run
|
18
|
+
end
|
19
|
+
|
20
|
+
should "separate commands and parameters" do
|
21
|
+
app = command("init myshot.com")
|
22
|
+
app.command.should == "init"
|
23
|
+
app.params.should == ["myshot.com"]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
context "File exists" do
|
28
|
+
should "be true if file exists" do
|
29
|
+
File.expects(:exists?).with(".pushand").returns(true)
|
30
|
+
app = Wn::App.new(["abcdef"])
|
31
|
+
app.file_exists(".pushand").should == true
|
32
|
+
end
|
33
|
+
|
34
|
+
should "be false if file exists" do
|
35
|
+
File.expects(:exists?).with(".gitignore").returns(false)
|
36
|
+
app = Wn::App.new(["abcdef"])
|
37
|
+
app.file_exists(".gitignore").should == false
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
context "Dir exists" do
|
42
|
+
should "be true if dir exists" do
|
43
|
+
File.expects(:directory?).with(".git").returns(true)
|
44
|
+
app = Wn::App.new(["abcdef"])
|
45
|
+
app.dir_exists(".git").should == true
|
46
|
+
|
47
|
+
File.expects(:directory?).with(".gita").returns(false)
|
48
|
+
app = Wn::App.new(["abcdef"])
|
49
|
+
app.dir_exists(".gita").should == false
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
context "Out" do
|
54
|
+
app = Wn::App.new(["abcdef"])
|
55
|
+
app.expects(:puts).with("help!")
|
56
|
+
app.out "help!"
|
57
|
+
|
58
|
+
app = Wn::App.new(["abcdef"])
|
59
|
+
app.expects(:puts).with("help me!")
|
60
|
+
app.out "help me!"
|
61
|
+
end
|
62
|
+
|
63
|
+
context "Create file" do
|
64
|
+
should "create a file with the given contexts" do
|
65
|
+
app = Wn::App.new(["abcdef"])
|
66
|
+
|
67
|
+
file = mock("file")
|
68
|
+
File.expects(:open).with("/var/rails/my_gosh", "w").yields(file)
|
69
|
+
file.expects(:write).with("my\nfair\nlady")
|
70
|
+
app.create_file "/var/rails/my_gosh", "my\nfair\nlady"
|
71
|
+
|
72
|
+
file = mock("file")
|
73
|
+
File.expects(:open).with("/var/rails/yahoo", "w").yields(file)
|
74
|
+
file.expects(:write).with("another_brick_in_the_wall")
|
75
|
+
app.create_file "/var/rails/yahoo", "another_brick_in_the_wall"
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
context "Git init" do
|
80
|
+
should "call git init and commit initial commit" do
|
81
|
+
app = Wn::App.new(["abcdef"])
|
82
|
+
app.expects(:sys_exec).with("git init")
|
83
|
+
|
84
|
+
app.expects(:app_name).with().returns("my_app")
|
85
|
+
app.expects(:sys_exec).with("git remote add webbynode git@2.2.3.3:my_app")
|
86
|
+
|
87
|
+
app.expects(:sys_exec).with("git add .")
|
88
|
+
app.expects(:sys_exec).with("git commit -m \"Initial commit\"")
|
89
|
+
|
90
|
+
app.git_init "2.2.3.3"
|
91
|
+
|
92
|
+
app = Wn::App.new(["abcdef"])
|
93
|
+
app.expects(:sys_exec).with("git init")
|
94
|
+
|
95
|
+
app.expects(:app_name).with().returns("another_app")
|
96
|
+
app.expects(:sys_exec).with("git remote add webbynode git@5.4.2.1:another_app")
|
97
|
+
|
98
|
+
app.expects(:sys_exec).with("git add .")
|
99
|
+
app.expects(:sys_exec).with("git commit -m \"Initial commit\"")
|
100
|
+
|
101
|
+
app.git_init "5.4.2.1"
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
context "Push command" do
|
106
|
+
should "push to webbynode master" do
|
107
|
+
app = command("push")
|
108
|
+
app.expects(:dir_exists).with(".git").returns(true)
|
109
|
+
app.expects(:app_name).with().returns("another_app")
|
110
|
+
app.expects(:out).with("Publishing another_app to Webbynode...")
|
111
|
+
app.expects(:sys_exec).with("git push webbynode master")
|
112
|
+
app.run
|
113
|
+
end
|
114
|
+
|
115
|
+
should "indicate not initialized" do
|
116
|
+
app = command("push")
|
117
|
+
app.expects(:dir_exists).with(".git").returns(false)
|
118
|
+
app.expects(:out).with("Not an application or missing initialization. Use 'webbynode init'.")
|
119
|
+
app.run
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
context "Init command" do
|
124
|
+
should "require one arguments" do
|
125
|
+
app = command("init")
|
126
|
+
app.expects(:out).with("usage: wn init webby_ip [host]")
|
127
|
+
app.run
|
128
|
+
end
|
129
|
+
|
130
|
+
should "create .gitignore" do
|
131
|
+
app = command("init 2.2.2.2 teste.myserver.com")
|
132
|
+
app.expects(:out).with("Creating .gitignore file...")
|
133
|
+
app.expects(:dir_exists).with(".git").returns(true)
|
134
|
+
app.expects(:file_exists).with(".pushand").returns(true)
|
135
|
+
app.expects(:file_exists).with(".gitignore").returns(false)
|
136
|
+
app.expects(:create_file).with(".gitignore", <<EOS)
|
137
|
+
config/database.yml
|
138
|
+
log/*
|
139
|
+
tmp/*
|
140
|
+
db/*.sqlite3
|
141
|
+
EOS
|
142
|
+
app.run
|
143
|
+
|
144
|
+
app = command("init 2.2.2.2")
|
145
|
+
app.expects(:out).with("Creating .gitignore file...")
|
146
|
+
app.expects(:app_name).with().returns("myapp")
|
147
|
+
app.expects(:dir_exists).with(".git").returns(true)
|
148
|
+
app.expects(:file_exists).with(".pushand").returns(true)
|
149
|
+
app.expects(:file_exists).with(".gitignore").returns(false)
|
150
|
+
app.expects(:create_file).with(".gitignore", <<EOS)
|
151
|
+
config/database.yml
|
152
|
+
log/*
|
153
|
+
tmp/*
|
154
|
+
db/*.sqlite3
|
155
|
+
EOS
|
156
|
+
app.run
|
157
|
+
end
|
158
|
+
|
159
|
+
should "create .pushand with host if missing" do
|
160
|
+
app = command("init 2.2.2.2 teste.myserver.com")
|
161
|
+
|
162
|
+
app.expects(:dir_exists).with(".git").returns(false)
|
163
|
+
app.expects(:out).with("Initializing git repository...")
|
164
|
+
app.expects(:git_init).with("2.2.2.2")
|
165
|
+
|
166
|
+
app.expects(:out).with("Initializing deployment descriptor for teste.myserver.com...")
|
167
|
+
app.expects(:file_exists).with(".gitignore").returns(true)
|
168
|
+
app.expects(:file_exists).with(".pushand").returns(false)
|
169
|
+
app.expects(:sys_exec).with("chmod +x .pushand")
|
170
|
+
app.expects(:create_file).with(".pushand", <<EOS)
|
171
|
+
#! /bin/bash
|
172
|
+
phd $0 teste.myserver.com
|
173
|
+
EOS
|
174
|
+
app.run
|
175
|
+
end
|
176
|
+
|
177
|
+
should "create .pushand with app name as the host if not specified" do
|
178
|
+
app = command("init 3.3.3.3")
|
179
|
+
|
180
|
+
app.expects(:dir_exists).with(".git").returns(true)
|
181
|
+
app.expects(:app_name).with().returns("myapp")
|
182
|
+
|
183
|
+
app.expects(:out).with("Initializing deployment descriptor for myapp...")
|
184
|
+
app.expects(:file_exists).with(".gitignore").returns(true)
|
185
|
+
app.expects(:file_exists).with(".pushand").returns(false)
|
186
|
+
app.expects(:sys_exec).with("chmod +x .pushand")
|
187
|
+
app.expects(:create_file).with(".pushand", <<EOS)
|
188
|
+
#! /bin/bash
|
189
|
+
phd $0 myapp
|
190
|
+
EOS
|
191
|
+
app.run
|
192
|
+
end
|
193
|
+
|
194
|
+
should "tell the app has already been initialized" do
|
195
|
+
app = command("init 5.5.5.5 teste.myserver.com")
|
196
|
+
app.expects(:dir_exists).with(".git").returns(true)
|
197
|
+
app.expects(:file_exists).with(".pushand").returns(true)
|
198
|
+
app.expects(:file_exists).with(".gitignore").returns(true)
|
199
|
+
app.expects(:create_file).never
|
200
|
+
app.run
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
end
|
data/webbynode.gemspec
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{webbynode}
|
5
|
+
s.version = "0.1.0"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Felipe Coury"]
|
9
|
+
s.date = %q{2010-01-11}
|
10
|
+
s.default_executable = %q{webbynode}
|
11
|
+
s.description = %q{Webbynode Deployment Gem}
|
12
|
+
s.email = %q{felipe@webbynode.com}
|
13
|
+
s.executables = ["webbynode"]
|
14
|
+
s.extra_rdoc_files = ["README.rdoc", "bin/webbynode", "lib/wn.rb"]
|
15
|
+
s.files = ["History.txt", "Manifest", "Manifest.txt", "PostInstall.txt", "README.rdoc", "Rakefile", "bin/webbynode", "lib/wn.rb", "oldRakefile", "test/test_helper.rb", "test/test_webbynode.rb", "test/test_wn.rb", "webbynode.gemspec"]
|
16
|
+
s.homepage = %q{http://webbynode.com}
|
17
|
+
s.post_install_message = %q{ -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
18
|
+
Webbynode deployment gem
|
19
|
+
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
20
|
+
|
21
|
+
This deployment engine is highly experimental and
|
22
|
+
should be considered beta code for the time being.
|
23
|
+
|
24
|
+
Commands:
|
25
|
+
|
26
|
+
webbynode init Initializes the current app for deployment to a Webby
|
27
|
+
webbynode push Deploys the current committed code to a Webby
|
28
|
+
|
29
|
+
}
|
30
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Webbynode", "--main", "README.rdoc"]
|
31
|
+
s.require_paths = ["lib"]
|
32
|
+
s.rubyforge_project = %q{webbynode}
|
33
|
+
s.rubygems_version = %q{1.3.5}
|
34
|
+
s.summary = %q{Webbynode Deployment Gem}
|
35
|
+
s.test_files = ["test/test_helper.rb", "test/test_webbynode.rb", "test/test_wn.rb"]
|
36
|
+
|
37
|
+
if s.respond_to? :specification_version then
|
38
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
39
|
+
s.specification_version = 3
|
40
|
+
|
41
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
42
|
+
else
|
43
|
+
end
|
44
|
+
else
|
45
|
+
end
|
46
|
+
end
|
metadata
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: webbynode
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Felipe Coury
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2010-01-11 00:00:00 -02:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Webbynode Deployment Gem
|
17
|
+
email: felipe@webbynode.com
|
18
|
+
executables:
|
19
|
+
- webbynode
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README.rdoc
|
24
|
+
- bin/webbynode
|
25
|
+
- lib/wn.rb
|
26
|
+
files:
|
27
|
+
- History.txt
|
28
|
+
- Manifest
|
29
|
+
- Manifest.txt
|
30
|
+
- PostInstall.txt
|
31
|
+
- README.rdoc
|
32
|
+
- Rakefile
|
33
|
+
- bin/webbynode
|
34
|
+
- lib/wn.rb
|
35
|
+
- oldRakefile
|
36
|
+
- test/test_helper.rb
|
37
|
+
- test/test_webbynode.rb
|
38
|
+
- test/test_wn.rb
|
39
|
+
- webbynode.gemspec
|
40
|
+
has_rdoc: true
|
41
|
+
homepage: http://webbynode.com
|
42
|
+
licenses: []
|
43
|
+
|
44
|
+
post_install_message: " -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n Webbynode deployment gem \n -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n\n This deployment engine is highly experimental and\n should be considered beta code for the time being.\n\n Commands:\n\n \twebbynode init\t\tInitializes the current app for deployment to a Webby\n \twebbynode push\t\tDeploys the current committed code to a Webby\n\n"
|
45
|
+
rdoc_options:
|
46
|
+
- --line-numbers
|
47
|
+
- --inline-source
|
48
|
+
- --title
|
49
|
+
- Webbynode
|
50
|
+
- --main
|
51
|
+
- README.rdoc
|
52
|
+
require_paths:
|
53
|
+
- lib
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: "0"
|
59
|
+
version:
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: "1.2"
|
65
|
+
version:
|
66
|
+
requirements: []
|
67
|
+
|
68
|
+
rubyforge_project: webbynode
|
69
|
+
rubygems_version: 1.3.5
|
70
|
+
signing_key:
|
71
|
+
specification_version: 3
|
72
|
+
summary: Webbynode Deployment Gem
|
73
|
+
test_files:
|
74
|
+
- test/test_helper.rb
|
75
|
+
- test/test_webbynode.rb
|
76
|
+
- test/test_wn.rb
|