-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy-environment.rb
156 lines (136 loc) · 4.47 KB
/
deploy-environment.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#! /usr/bin/env/ruby
require 'chef/provisioning/docker_driver'
with_driver 'docker'
chef_env = '_default'
domain = 'calavera.biz'
subdomain = "#{domain}"
hname="cerebro"
machine_image "#{hname}.#{domain}" do
#recipe "git::default"
recipe "base::default"
recipe "cerebro::default"
chef_environment chef_env
machine_options :docker_options => {
:base_image => {
:name => 'phusion/baseimage',
:hostname => "#{hname}.#{domain}",
:repository => 'phusion',
:tag => '0.9.16',
},
:env => {
"HOSTNAME" => "#{hname}.#{domain}"
},
:volumes => ["/opt/Calavera-chef-provision:/home/vagrant","/opt/Calavera-chef-provision:/home/#{hname}","/opt/Calavera-chef-provision/shared:/mnt/shared"],
:command => '/sbin/my_init'
}
#action :destroy
end
hname="brazos"
machine_image "#{hname}.#{domain}" do
recipe "base::default"
recipe "java7::default"
recipe "localAnt::default"
recipe "brazos::default"
recipe "git::default"
recipe "tomcat::default"
recipe "shared::_junit"
chef_environment chef_env
machine_options :docker_options => {
:base_image => {
:name => 'phusion/baseimage',
:hostname => "#{hname}.#{domain}",
:repository => 'phusion',
:tag => '0.9.16',
},
:env => {
"HOSTNAME" => "#{hname}.#{domain}"
},
:volumes => ["/opt/Calavera-chef-provision:/home/vagrant","/opt/Calavera-chef-provision:/home/#{hname}","/opt/Calavera-chef-provision/shared:/mnt/shared"],
:command => '/sbin/my_init'
}
end
hname="espina"
machine_image "#{hname}.#{domain}" do
recipe "base::default"
recipe "shared::default"
recipe "java7::default"
recipe "espina::default"
chef_environment chef_env
machine_options :docker_options => {
:base_image => {
:name => 'phusion/baseimage',
:hostname => "#{hname}.#{domain}",
:repository => 'phusion',
:tag => '0.9.16',
},
:env => {
"HOSTNAME" => "#{hname}.#{domain}"
},
:volumes => ["/opt/Calavera-chef-provision:/home/vagrant","/opt/Calavera-chef-provision:/home/#{hname}","/opt/Calavera-chef-provision/shared:/mnt/shared"],
:command => '/sbin/my_init'
}
end
hname="hombros"
machine_image "#{hname}.#{domain}" do
recipe "base::default"
recipe "jenkins::master"
recipe "hombros::default"
chef_environment chef_env
machine_options :docker_options => {
:base_image => {
:name => 'phusion/baseimage',
:hostname => "#{hname}.#{domain}",
:repository => 'phusion',
:tag => '0.9.16',
},
:env => {
"HOSTNAME" => "#{hname}.#{domain}"
},
:volumes => ["/opt/Calavera-chef-provision:/home/vagrant","/opt/Calavera-chef-provision:/home/#{hname}","/opt/Calavera-chef-provision/shared:/mnt/shared"],
:command => '/sbin/my_init'
}
end
hname="manos"
machine_image "#{hname}.#{domain}" do
recipe "base::default"
recipe "localAnt::default"
recipe "java7::default" # for some reason the Java recipe must be re-run to install Tomcat
recipe "shared::_junit"
recipe "manos::default"
chef_environment chef_env
machine_options :docker_options => {
:base_image => {
:name => 'phusion/baseimage',
:hostname => "#{hname}.#{domain}",
:repository => 'phusion',
:tag => '0.9.16',
},
:env => {
"HOSTNAME" => "#{hname}.#{domain}"
},
:volumes => ["/opt/Calavera-chef-provision:/home/vagrant","/opt/Calavera-chef-provision:/home/#{hname}","/opt/Calavera-chef-provision/shared:/mnt/shared"],
:command => '/sbin/my_init'
}
#action :destroy
end
hname="cara"
machine_image "#{hname}.#{domain}" do
recipe "base::default"
recipe "java7::default" # for some reason the Java recipe must be re-run to install Tomcat
recipe "cara::default"
chef_environment chef_env
machine_options :docker_options => {
:base_image => {
:name => 'phusion/baseimage',
:hostname => "#{hname}.#{domain}",
:repository => 'phusion',
:tag => '0.9.16',
},
:env => {
"HOSTNAME" => "#{hname}.#{domain}"
},
:volumes => ["/opt/Calavera-chef-provision:/home/vagrant","/opt/Calavera-chef-provision:/home/#{hname}","/opt/Calavera-chef-provision/shared:/mnt/shared"],
:command => '/sbin/my_init'
}
#action :destroy
end