fezzik 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -1
- data/bin/fezify +19 -2
- data/fezzik.gemspec +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -10,6 +10,7 @@ and gets out of your way.
|
|
10
10
|
sudo gem install fezzik
|
11
11
|
|
12
12
|
## Setup
|
13
|
+
|
13
14
|
$ cd myproject
|
14
15
|
$ ls
|
15
16
|
server.rb
|
@@ -28,7 +29,7 @@ and gets out of your way.
|
|
28
29
|
|
29
30
|
**bin/run_app.sh**: write a command that will start your app
|
30
31
|
#!/bin/sh
|
31
|
-
nohup ruby server.rb &
|
32
|
+
nohup ruby server.rb > /dev/null 2>&1 &
|
32
33
|
|
33
34
|
Ready to deploy!
|
34
35
|
$ fez to_prod deploy
|
data/bin/fezify
CHANGED
@@ -42,6 +42,12 @@ end
|
|
42
42
|
# destination servers. This is a decent initial setup, but is completely configurable.
|
43
43
|
|
44
44
|
namespace :fezzik do
|
45
|
+
# Any variables set in deploy.rb with "env" will be saved on the server in two files:
|
46
|
+
# config/environment.sh and config/environment.rb. The first is loaded into the shell
|
47
|
+
# environment before the run script is called, and the second is made available to
|
48
|
+
# be required into your code. You can use your own environment.rb file for development,
|
49
|
+
# and it will be overwritten by this task when the code deploys.
|
50
|
+
desc "saves variables set by 'env' in deploy.rb into config/environment.sh and config/environment.rb"
|
45
51
|
task :save_environment do
|
46
52
|
system("mkdir -p /tmp/#\{app\}/config")
|
47
53
|
File.open("/tmp/#\{app\}/config/environment.rb", "w") do |file|
|
@@ -56,6 +62,7 @@ namespace :fezzik do
|
|
56
62
|
end
|
57
63
|
end
|
58
64
|
|
65
|
+
desc "stages the project for deployment in /tmp"
|
59
66
|
task :stage do
|
60
67
|
puts "staging project in /tmp/#\{app\}"
|
61
68
|
system("rm -fr /tmp/#\{app\}")
|
@@ -63,39 +70,49 @@ namespace :fezzik do
|
|
63
70
|
Rake::Task["fezzik:save_environment"].invoke
|
64
71
|
end
|
65
72
|
|
73
|
+
desc "performs any necessary setup on the destination servers prior to deployment"
|
66
74
|
remote_task :setup do
|
67
75
|
puts "setting up servers"
|
68
76
|
run "mkdir -p #\{deploy_to\}/releases"
|
69
77
|
end
|
70
78
|
|
79
|
+
desc "rsyncs the project from its stages location to each destination server"
|
71
80
|
remote_task :push => [:stage, :setup] do
|
72
81
|
puts "pushing to #\{target_host\}"
|
73
82
|
rsync "-q", "/tmp/#\{app\}/", "#\{target_host\}:#\{release_path\}"
|
74
83
|
end
|
75
84
|
|
76
|
-
|
85
|
+
desc "symlinks the latest deployment to /deploy_path/project/current"
|
86
|
+
remote_task :symlink do
|
77
87
|
puts "symlinking current to #\{release_path\}"
|
78
88
|
run "cd #\{deploy_to\} && ln -fns #\{release_path\} current"
|
79
89
|
end
|
80
90
|
|
91
|
+
desc "runs the executable in project/bin"
|
81
92
|
remote_task :start do
|
82
93
|
puts "starting from #\{release_path\}"
|
83
94
|
run "cd #\{current_path\} && source config/environment.sh" +
|
84
95
|
" && ./bin/run_app.sh"
|
85
96
|
end
|
86
97
|
|
98
|
+
desc "kills the application by searching for the specified process name"
|
87
99
|
remote_task :stop do
|
88
100
|
puts "stopping app"
|
89
101
|
# Replace YOUR_APP_NAME with whatever is run from your bin/run_app.sh file.
|
90
102
|
# run "(kill -9 `ps aux | grep 'YOUR_APP_NAME' | grep -v grep | awk '\{print $2\}'` || true)"
|
91
103
|
end
|
92
104
|
|
105
|
+
desc "restarts the application"
|
93
106
|
remote_task :restart do
|
94
107
|
Rake::Task["fezzik:stop"].invoke
|
95
108
|
Rake::Task["fezzik:start"].invoke
|
96
109
|
end
|
97
110
|
|
98
|
-
|
111
|
+
desc "full deployment pipeline"
|
112
|
+
task :deploy do
|
113
|
+
Rake::Task["fezzik:push"].invoke
|
114
|
+
Rake::Task["fezzik:symlink"].invoke
|
115
|
+
Rake::Task["fezzik:restart"].invoke
|
99
116
|
puts "#\{app\} deployed!"
|
100
117
|
end
|
101
118
|
end
|
data/fezzik.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "fezzik"
|
3
|
-
s.version = "0.1.
|
3
|
+
s.version = "0.1.3"
|
4
4
|
|
5
5
|
s.required_rubygems_version = Gem::Requirement.new(">=0") if s.respond_to? :required_rubygems_version=
|
6
6
|
s.specification_version = 2 if s.respond_to? :specification_version=
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fezzik
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Daniel MacDougall
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-03-
|
18
|
+
date: 2011-03-04 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|