Skip to content

Commit 8d85525

Browse files
committed
last second changes
1 parent a34938c commit 8d85525

File tree

2 files changed

+23
-118
lines changed

2 files changed

+23
-118
lines changed

software/infrastructure/jenkins.template

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,18 @@
115115
"config" : {
116116
"packages" : {
117117
"yum" : {
118-
"java-1.6.0-openjdk" : [],
119-
"tomcat6" : [],
120-
"git" : [],
121-
"make" : [],
122-
"gcc" : [],
123-
"sqlite-devel" : [],
124-
"libxml2-devel" : [],
125-
"libxslt-devel" : [],
126-
"libyaml-devel" : []
118+
"tomcat6" : [],
119+
"ant" : [],
120+
"java-1.6.0-openjdk-devel": [],
121+
"mysql-server" : [],
122+
"mysql" : [],
123+
"git" : [],
124+
"make" : [],
125+
"gcc" : [],
126+
"sqlite-devel" : [],
127+
"libxml2-devel" : [],
128+
"libxslt-devel" : [],
129+
"libyaml-devel" : []
127130
}
128131
},
129132

@@ -202,6 +205,9 @@
202205
" --access-key ", { "Ref" : "HostKeys" },
203206
" --secret-key ", {"Fn::GetAtt": ["HostKeys", "SecretAccessKey"]},
204207
" --region ", { "Ref" : "AWS::Region" }, " || error_exit 'Failed to run cfn-init'\n",
208+
209+
"sudo service mysqld start\n",
210+
"/usr/bin/mysqladmin -u root password 'mysql'\n",
205211

206212
"# Copy Github credentials to root ssh directory\n",
207213
"cp /usr/share/tomcat6/.ssh/* /root/.ssh/\n",

software/infrastructure/target.template

Lines changed: 8 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,6 @@
2121
"Default" : "c1.medium",
2222
"ConstraintDescription" : "must be a valid EC2 instance type."
2323
},
24-
25-
"ApplicationName" : {
26-
"Description" : "CNAME for the application",
27-
"Type" : "String",
28-
"Default" : "target"
29-
},
30-
31-
"HostedZone" : {
32-
"Description" : "Domain to use",
33-
"Type" : "String",
34-
"Default" : "devopscloud.com"
35-
},
36-
37-
"EnvironmentType" : {
38-
"Description" : "Mode for rails to run in",
39-
"Type" : "String",
40-
"Default" : "development"
41-
},
4224

4325
"PrivateBucket" : {
4426
"Description" : "S3 bucket for storing credentials",
@@ -110,20 +92,6 @@
11092
}
11193
},
11294

113-
"Domain" : {
114-
"Type" : "AWS::Route53::RecordSetGroup",
115-
"Properties" : {
116-
"HostedZoneName" : { "Fn::Join" : [ "", [ {"Ref" : "HostedZone"}, "." ]]},
117-
"RecordSets" : [
118-
{
119-
"Name" : { "Fn::Join" : ["", [ { "Ref" : "ApplicationName" }, ".", { "Ref" : "HostedZone" }, "." ]]},
120-
"Type" : "A",
121-
"TTL" : "900",
122-
"ResourceRecords" : [ { "Ref" : "IPAddress" } ]
123-
}]
124-
}
125-
},
126-
12795
"WebServer": {
12896
"Type": "AWS::EC2::Instance",
12997
"DependsOn" : "PrivateBucketPolicy",
@@ -132,67 +100,21 @@
132100
"config" : {
133101
"packages" : {
134102
"yum" : {
135-
"puppet" : []
103+
"mysql-server" : [],
104+
"mysql" : [],
105+
"ant" : [],
106+
"tomcat6" : []
136107
}
137108
},
138109

139-
"sources" : {
140-
"/home/ec2-user/" : { "Fn::Join" : ["", ["https://s3.amazonaws.com/stelligentlabs/puppet.tar.gz"]]}
141-
},
142-
143110
"files" : {
144111
"/home/ec2-user/id_rsa.pub" : {
145112
"source" : { "Fn::Join" : ["", ["https://s3.amazonaws.com/", { "Ref" : "PrivateBucket" }, "/id_rsa.pub"]]},
146113
"mode" : "000500",
147114
"owner" : "root",
148115
"group" : "root",
149116
"authentication" : "S3AccessCreds"
150-
},
151-
"/home/ec2-user/nodes.pp" : {
152-
"content" : { "Fn::Join" : ["", [
153-
"node default {\n",
154-
"include system\n",
155-
"include bundler\n",
156-
"include passenger\n",
157-
"include sqlite\n",
158-
"include git\n",
159-
"include httpd\n",
160-
"}"
161-
]]},
162-
"mode" : "000500",
163-
"owner" : "root",
164-
"group" : "root"
165-
},
166-
167-
168-
"/etc/httpd/conf/virtualhosts" : {
169-
"content" : { "Fn::Join" : ["", [
170-
"NameVirtualHost *:80\n",
171-
"<VirtualHost *:80>\n",
172-
"ServerName ", { "Fn::Join" : [ ".", [ { "Ref" : "ApplicationName" }, { "Ref" : "HostedZone" }]]}, "\n",
173-
"ServerAlias ", { "Fn::Join" : [ ".", [ { "Ref" : "ApplicationName" }, { "Ref" : "HostedZone" }]]}, "\n",
174-
"RailsEnv ", {"Ref" : "EnvironmentType"}, "\n",
175-
"DocumentRoot /var/www/rails/public\n",
176-
"<Directory /var/www/rails/public>\n",
177-
"AllowOverride all\n",
178-
"Options -MultiViews\n",
179-
"</Directory>\n",
180-
"</VirtualHost>\n"
181-
]]},
182-
"mode" : "000500",
183-
"owner" : "root",
184-
"group" : "root"
185-
},
186-
"/etc/httpd/conf/passenger" : {
187-
"content" : { "Fn::Join" : ["", [
188-
"LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.13/ext/apache2/mod_passenger.so\n",
189-
"PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.13\n",
190-
"PassengerRuby /usr/bin/ruby\n"
191-
]]},
192-
"mode" : "000500",
193-
"owner" : "root",
194-
"group" : "root"
195-
}
117+
}
196118
}
197119
}
198120
},
@@ -224,12 +146,9 @@
224146
" --secret-key ", {"Fn::GetAtt": ["HostKeys", "SecretAccessKey"]},
225147
" --region ", { "Ref" : "AWS::Region" }, " || error_exit 'Failed to run cfn-init'\n",
226148

227-
"# Build environment using Puppet\n",
228-
"puppet apply --modulepath=/home/ec2-user/modules /home/ec2-user/nodes.pp\n",
229-
230-
"# Add in virtual hosts config\n",
231-
"cat /etc/httpd/conf/passenger >> /etc/httpd/conf/httpd.conf\n",
232-
"cat /etc/httpd/conf/virtualhosts >> /etc/httpd/conf/httpd.conf\n",
149+
"sudo service mysqld start\n",
150+
"/usr/bin/mysqladmin -u root password 'mysql'\n",
151+
"sudo service tomcat6 start \n",
233152

234153
"# Add Public key for passwordless authentication from Jenkins Instance\n",
235154
"cat /home/ec2-user/id_rsa.pub >> /home/ec2-user/.ssh/authorized_keys\n",
@@ -244,18 +163,6 @@
244163
]]}}
245164
}
246165
},
247-
248-
"IPAddress" : {
249-
"Type" : "AWS::EC2::EIP"
250-
},
251-
252-
"IPAssoc" : {
253-
"Type" : "AWS::EC2::EIPAssociation",
254-
"Properties" : {
255-
"InstanceId" : { "Ref" : "WebServer" },
256-
"EIP" : { "Ref" : "IPAddress" }
257-
}
258-
},
259166

260167
"FrontendGroup" : {
261168
"Type" : "AWS::EC2::SecurityGroup",
@@ -291,14 +198,6 @@
291198
},
292199
"ArtifactBucket" : {
293200
"Value" : { "Ref" : "PublicBucket" }
294-
},
295-
"Domain" : {
296-
"Value" : { "Fn::Join" : ["", [{ "Ref" : "ApplicationName" }, ".", { "Ref" : "HostedZone" }]] },
297-
"Description" : "Full domain"
298-
},
299-
"SampleApp" : {
300-
"Value" : { "Fn::Join" : ["", ["http://", { "Ref" : "ApplicationName" }, ".", { "Ref" : "HostedZone" }, "/"]] },
301-
"Description" : "URL for newly created Sample App"
302201
}
303202
}
304203
}

0 commit comments

Comments
 (0)