sunshine 1.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +237 -0
- data/Manifest.txt +70 -0
- data/README.txt +277 -0
- data/Rakefile +46 -0
- data/bin/sunshine +5 -0
- data/examples/deploy.rb +61 -0
- data/examples/deploy_tasks.rake +112 -0
- data/examples/standalone_deploy.rb +31 -0
- data/lib/commands/add.rb +96 -0
- data/lib/commands/default.rb +169 -0
- data/lib/commands/list.rb +322 -0
- data/lib/commands/restart.rb +62 -0
- data/lib/commands/rm.rb +83 -0
- data/lib/commands/run.rb +151 -0
- data/lib/commands/start.rb +72 -0
- data/lib/commands/stop.rb +61 -0
- data/lib/sunshine/app.rb +876 -0
- data/lib/sunshine/binder.rb +70 -0
- data/lib/sunshine/crontab.rb +143 -0
- data/lib/sunshine/daemon.rb +380 -0
- data/lib/sunshine/daemons/ar_sendmail.rb +28 -0
- data/lib/sunshine/daemons/delayed_job.rb +30 -0
- data/lib/sunshine/daemons/nginx.rb +104 -0
- data/lib/sunshine/daemons/rainbows.rb +35 -0
- data/lib/sunshine/daemons/server.rb +66 -0
- data/lib/sunshine/daemons/unicorn.rb +26 -0
- data/lib/sunshine/dependencies.rb +103 -0
- data/lib/sunshine/dependency_lib.rb +200 -0
- data/lib/sunshine/exceptions.rb +54 -0
- data/lib/sunshine/healthcheck.rb +83 -0
- data/lib/sunshine/output.rb +131 -0
- data/lib/sunshine/package_managers/apt.rb +48 -0
- data/lib/sunshine/package_managers/dependency.rb +349 -0
- data/lib/sunshine/package_managers/gem.rb +54 -0
- data/lib/sunshine/package_managers/yum.rb +62 -0
- data/lib/sunshine/remote_shell.rb +241 -0
- data/lib/sunshine/repo.rb +128 -0
- data/lib/sunshine/repos/git_repo.rb +122 -0
- data/lib/sunshine/repos/rsync_repo.rb +29 -0
- data/lib/sunshine/repos/svn_repo.rb +78 -0
- data/lib/sunshine/server_app.rb +554 -0
- data/lib/sunshine/shell.rb +384 -0
- data/lib/sunshine.rb +391 -0
- data/templates/logrotate/logrotate.conf.erb +11 -0
- data/templates/nginx/nginx.conf.erb +109 -0
- data/templates/nginx/nginx_optimize.conf +23 -0
- data/templates/nginx/nginx_proxy.conf +13 -0
- data/templates/rainbows/rainbows.conf.erb +18 -0
- data/templates/tasks/sunshine.rake +114 -0
- data/templates/unicorn/unicorn.conf.erb +6 -0
- data/test/fixtures/app_configs/test_app.yml +11 -0
- data/test/fixtures/sunshine_test/test_upload +0 -0
- data/test/mocks/mock_object.rb +179 -0
- data/test/mocks/mock_open4.rb +117 -0
- data/test/test_helper.rb +188 -0
- data/test/unit/test_app.rb +489 -0
- data/test/unit/test_binder.rb +20 -0
- data/test/unit/test_crontab.rb +128 -0
- data/test/unit/test_git_repo.rb +26 -0
- data/test/unit/test_healthcheck.rb +70 -0
- data/test/unit/test_nginx.rb +107 -0
- data/test/unit/test_rainbows.rb +26 -0
- data/test/unit/test_remote_shell.rb +102 -0
- data/test/unit/test_repo.rb +42 -0
- data/test/unit/test_server.rb +324 -0
- data/test/unit/test_server_app.rb +425 -0
- data/test/unit/test_shell.rb +97 -0
- data/test/unit/test_sunshine.rb +157 -0
- data/test/unit/test_svn_repo.rb +55 -0
- data/test/unit/test_unicorn.rb +22 -0
- metadata +217 -0
@@ -0,0 +1,61 @@
|
|
1
|
+
module Sunshine
|
2
|
+
|
3
|
+
##
|
4
|
+
# Runs the stop script of all specified sunshine apps.
|
5
|
+
#
|
6
|
+
# Usage: sunshine stop app_name [more names...] [options]
|
7
|
+
#
|
8
|
+
# Arguments:
|
9
|
+
# app_name Name of the application to stop.
|
10
|
+
#
|
11
|
+
# Options:
|
12
|
+
# -f, --format FORMAT Set the output format (txt, yml, json)
|
13
|
+
# -u, --user USER User to use for remote login. Use with -r.
|
14
|
+
# -r, --remote svr1,svr2 Run on one or more remote servers.
|
15
|
+
# -v, --verbose Run in verbose mode.
|
16
|
+
|
17
|
+
class StopCommand < ListCommand
|
18
|
+
|
19
|
+
##
|
20
|
+
# Takes an array and a hash, runs the command and returns:
|
21
|
+
# true: success
|
22
|
+
# false: failed
|
23
|
+
# exitcode:
|
24
|
+
# code == 0: success
|
25
|
+
# code != 0: failed
|
26
|
+
# and optionally an accompanying message.
|
27
|
+
|
28
|
+
def self.exec names, config
|
29
|
+
output = exec_each_server config do |shell|
|
30
|
+
new(shell).stop(names)
|
31
|
+
end
|
32
|
+
|
33
|
+
return output
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
##
|
38
|
+
# Stop specified apps.
|
39
|
+
|
40
|
+
def stop app_names
|
41
|
+
status_after_command :stop, app_names
|
42
|
+
end
|
43
|
+
|
44
|
+
##
|
45
|
+
# Parses the argv passed to the command
|
46
|
+
|
47
|
+
def self.parse_args argv
|
48
|
+
parse_remote_args(argv) do |opt, options|
|
49
|
+
opt.banner = <<-EOF
|
50
|
+
|
51
|
+
Usage: #{opt.program_name} stop app_name [more names...] [options]
|
52
|
+
|
53
|
+
Arguments:
|
54
|
+
app_name Name of the application to stop.
|
55
|
+
EOF
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|