-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.rb
93 lines (73 loc) · 2.89 KB
/
setup.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/usr/bin/env sprinkle -s
# Annotated Example Sprinkle Rails deployment script
#
# This is an example Sprinkle script configured to install Rails from gems, Apache, Ruby,
# Sphinx and Git from source, and mysql and Git dependencies from apt on an Ubuntu system.
#
# Installation is configured to run via capistrano (and an accompanying deploy.rb recipe script).
# Source based packages are downloaded and built into /usr/local on the remote system.
#
# A sprinkle script is separated into 3 different sections. Packages, policies and deployment:
# Packages (separate files for brevity)
#
# Defines the world of packages as we know it. Each package has a name and
# set of metadata including its installer type (eg. apt, source, gem, etc). Packages can have
# relationships to each other via dependencies.
Dir[File.dirname(__FILE__)+'/packages/*.rb'].each {|e| require e}
# require 'packages/essential'
# require 'packages/rails'
# require 'packages/database'
# require 'packages/server'
# require 'packages/search'
# require 'packages/scm'
# require 'packages/processing'
# require 'packages/monitoring'
# Policies
#
# Names a group of packages (optionally with versions) that apply to a particular set of roles:
#
# Associates the rails policy to the application servers. Contains rails, and surrounding
# packages. Note, appserver, database, webserver and search are all virtual packages defined above.
# If there's only one implementation of a virtual package, it's selected automatically, otherwise
# the user is requested to select which one to use.
policy :rails, :roles => :app do
# requires :build_essential
# requires :editors
# requires :rails, :version => '2.3.5'
# requires :appserver
# requires :database
# requires :webserver
# requires :search
# requires :svn
# requires :git
# requires :imageprocessing
# requires :monitoring
requires :messaging
end
puts %{
Setting up the standard-issue Buffpojken-server.\n
Note that this setup is only meant for Ubuntu/Debian systems, and mostly tested on Hardy, Intrepid and Jaunty\n
Choose webserver and SCM below:"
}
# Deployment
#
# Defines script wide settings such as a delivery mechanism for executing commands on the target
# system (eg. capistrano), and installer defaults (eg. build locations, etc):
#
# Configures spinkle to use capistrano for delivery of commands to the remote machines (via
# the named 'deploy' recipe). Also configures 'source' installer defaults to put package gear
# in /usr/local
deployment do
# mechanism for deployment
delivery :capistrano do
recipes File.dirname(__FILE__)+'/deploy.rb'
end
# source based package installer defaults
source do
prefix '/usr/local'
archives '/usr/local/sources'
builds '/usr/local/build'
end
end
# End of script, given the above information, Spinkle will apply the defined policy on all roles using the
# deployment settings specified.