railshoster 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -0
- data/README.textile +3 -1
- data/gemfiles/Gemfile.ci +1 -0
- data/lib/init.rb +4 -3
- data/lib/railshoster/init_command.rb +32 -4
- data/lib/railshoster/version.rb +1 -1
- data/railshoster.gemspec +2 -1
- data/spec/spec_helper.rb +1 -0
- metadata +23 -8
data/Gemfile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# A dummy Gemfile
|
data/README.textile
CHANGED
@@ -10,11 +10,13 @@ h2. Requirements
|
|
10
10
|
|
11
11
|
This is what you need on your client to run the RailsHoster gem to deploy your app:
|
12
12
|
|
13
|
+
* Non-Windows OS (you might be able to use cygwin but this is untested so far)
|
13
14
|
* Ruby
|
14
|
-
* Ruby
|
15
|
+
* Ruby Gems
|
15
16
|
* Shell (e.g. Bash)
|
16
17
|
* SSH Shell
|
17
18
|
* Git
|
19
|
+
* Currently the railshoster gem assumes bundler to be used. Let us know if this is a problem for you.
|
18
20
|
|
19
21
|
h2. Installation
|
20
22
|
|
data/gemfiles/Gemfile.ci
CHANGED
data/lib/init.rb
CHANGED
@@ -3,6 +3,7 @@ require 'json'
|
|
3
3
|
require 'git'
|
4
4
|
require 'fileutils'
|
5
5
|
require 'net/sftp'
|
6
|
+
require 'sane'
|
6
7
|
|
7
8
|
require File.expand_path(File.join(File.dirname(__FILE__), '/capistrano/h'))
|
8
9
|
|
@@ -11,10 +12,6 @@ module Railshoster
|
|
11
12
|
# This action class helps to setup a new rails applicaton
|
12
13
|
class InitCommand < Command
|
13
14
|
|
14
|
-
def initialize(project_dir)
|
15
|
-
super(project_dir)
|
16
|
-
end
|
17
|
-
|
18
15
|
def run_by_application_token(application_token)
|
19
16
|
decoded_token = decode_token(application_token)
|
20
17
|
|
@@ -30,6 +27,8 @@ module Railshoster
|
|
30
27
|
end
|
31
28
|
|
32
29
|
def run_by_application_hash(application_hash_as_json_string)
|
30
|
+
check_system_requirements
|
31
|
+
check_project_requirements
|
33
32
|
app_hash = parse_application_json_hash(application_hash_as_json_string)
|
34
33
|
|
35
34
|
# Extract GIT URL from project and add it to the app_hash
|
@@ -49,6 +48,35 @@ module Railshoster
|
|
49
48
|
|
50
49
|
protected
|
51
50
|
|
51
|
+
def check_system_requirements
|
52
|
+
check_os
|
53
|
+
end
|
54
|
+
|
55
|
+
def check_project_requirements
|
56
|
+
#TOOD implement
|
57
|
+
# check_git
|
58
|
+
|
59
|
+
check_gemfile
|
60
|
+
end
|
61
|
+
|
62
|
+
def check_gemfile
|
63
|
+
gem_file = File.join(@project_dir, "Gemfile")
|
64
|
+
unless File.exists?(gem_file) then
|
65
|
+
puts "\nWarning: Your project does not seem to have a Gemfile. Please ensure your are using bundler."
|
66
|
+
exit_now!("Initialization aborted. No Gemfile found.", -1)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def check_os
|
71
|
+
if OS.windows? then
|
72
|
+
puts "\nWarning: This software requires a Unix/Linux/BSD OS. Do you really want to proceed?"
|
73
|
+
decision = STDIN.gets.chomp
|
74
|
+
unless %w(y Y).include?(decision) then
|
75
|
+
exit_now!("Initialization aborted. Bad operating system.", -1)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
52
80
|
def create_remote_authorized_key_file_from_public_ssh_key(app_hash, key)
|
53
81
|
remote_dot_ssh_path = ".ssh"
|
54
82
|
remote_authorized_keys_path = remote_dot_ssh_path + "/authorized_keys"
|
data/lib/railshoster/version.rb
CHANGED
data/railshoster.gemspec
CHANGED
@@ -24,7 +24,8 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.add_dependency "gli", ">= 1.2.5"
|
25
25
|
s.add_dependency "json"
|
26
26
|
s.add_dependency "git"
|
27
|
-
s.add_dependency
|
27
|
+
s.add_dependency "erubis"
|
28
|
+
s.add_dependency "sane"
|
28
29
|
|
29
30
|
s.add_development_dependency('rspec')
|
30
31
|
s.add_development_dependency('fakefs')
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: railshoster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 4
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.4.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Julian Fischer
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-11-
|
18
|
+
date: 2011-11-15 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: bundler
|
@@ -120,7 +120,7 @@ dependencies:
|
|
120
120
|
type: :runtime
|
121
121
|
version_requirements: *id007
|
122
122
|
- !ruby/object:Gem::Dependency
|
123
|
-
name:
|
123
|
+
name: sane
|
124
124
|
prerelease: false
|
125
125
|
requirement: &id008 !ruby/object:Gem::Requirement
|
126
126
|
none: false
|
@@ -131,10 +131,10 @@ dependencies:
|
|
131
131
|
segments:
|
132
132
|
- 0
|
133
133
|
version: "0"
|
134
|
-
type: :
|
134
|
+
type: :runtime
|
135
135
|
version_requirements: *id008
|
136
136
|
- !ruby/object:Gem::Dependency
|
137
|
-
name:
|
137
|
+
name: rspec
|
138
138
|
prerelease: false
|
139
139
|
requirement: &id009 !ruby/object:Gem::Requirement
|
140
140
|
none: false
|
@@ -148,7 +148,7 @@ dependencies:
|
|
148
148
|
type: :development
|
149
149
|
version_requirements: *id009
|
150
150
|
- !ruby/object:Gem::Dependency
|
151
|
-
name:
|
151
|
+
name: fakefs
|
152
152
|
prerelease: false
|
153
153
|
requirement: &id010 !ruby/object:Gem::Requirement
|
154
154
|
none: false
|
@@ -161,6 +161,20 @@ dependencies:
|
|
161
161
|
version: "0"
|
162
162
|
type: :development
|
163
163
|
version_requirements: *id010
|
164
|
+
- !ruby/object:Gem::Dependency
|
165
|
+
name: mocha
|
166
|
+
prerelease: false
|
167
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
168
|
+
none: false
|
169
|
+
requirements:
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
hash: 3
|
173
|
+
segments:
|
174
|
+
- 0
|
175
|
+
version: "0"
|
176
|
+
type: :development
|
177
|
+
version_requirements: *id011
|
164
178
|
description: Easily deploy your Rails app to RailsHoster.com by using this gem.
|
165
179
|
email:
|
166
180
|
- fischer@enterprise-rails.de
|
@@ -175,6 +189,7 @@ files:
|
|
175
189
|
- .travis.yml
|
176
190
|
- CHANGELOG.textile
|
177
191
|
- CONTRIB.txt
|
192
|
+
- Gemfile
|
178
193
|
- LICENSE
|
179
194
|
- README.textile
|
180
195
|
- ROADMAP.textile
|