|
8 | 8 | "KeyName" : {
|
9 | 9 | "Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances",
|
10 | 10 | "Type" : "String",
|
11 |
| - "Default" : "manatee_dev", |
| 11 | + "Default" : "cd30", |
12 | 12 | "MinLength": "1",
|
13 | 13 | "MaxLength": "64",
|
14 | 14 | "AllowedPattern" : "[-_ a-zA-Z0-9]*",
|
|
31 | 31 | "Type" : "String",
|
32 | 32 | "Default" : "oneclickdeployment.com"
|
33 | 33 | },
|
34 |
| - |
35 |
| - "SvnID" : { |
36 |
| - "Description" : "Sea2Shore Svn Username", |
37 |
| - "Type" : "String", |
38 |
| - "Default" : "paul.duvall" |
39 |
| - }, |
40 |
| - |
41 |
| - "SvnPassword" : { |
42 |
| - "Description" : "Sea2Shore Svn User Password", |
43 |
| - "Type" : "String", |
44 |
| - "NoEcho" : "TRUE", |
45 |
| - "Default" : "G6bIGZS4gNFp" |
46 |
| - }, |
47 | 34 |
|
48 | 35 | "S3Bucket" : {
|
49 | 36 | "Description" : "Artifact Bucket",
|
50 | 37 | "Type" : "String",
|
51 |
| - "Default" : "sea2shore" |
| 38 | + "Default" : "cdcourse" |
52 | 39 | }
|
53 | 40 | },
|
54 | 41 |
|
|
130 | 117 | },
|
131 | 118 |
|
132 | 119 | "sources" : {
|
133 |
| - "/opt/aws/apitools/" : "https://s3.amazonaws.com/sea2shore/resources/binaries/CloudFormation-CLI.zip", |
134 |
| - "/usr/share/tomcat6/scripts/" : "https://s3.amazonaws.com/sea2shore/jenkins_utilities.tar.gz" |
| 120 | + "/opt/aws/apitools/" : "https://s3.amazonaws.com/cdcourse/repo/CloudFormation-CLI.zip", |
| 121 | + "/usr/share/tomcat6/scripts/" : "https://s3.amazonaws.com/cdcourse/repo/jenkins_utilities.tar.gz" |
135 | 122 | },
|
136 | 123 |
|
137 | 124 | "files" : {
|
138 | 125 | "/usr/bin/aws" : {
|
139 |
| - "source" : "https://s3.amazonaws.com/sea2shore/resources/aws_tools/aws", |
| 126 | + "source" : "https://raw.github.com/stelligent/continuous_integration_example/master/software/repo/aws", |
140 | 127 | "mode" : "000777",
|
141 | 128 | "owner" : "tomcat",
|
142 | 129 | "group" : "tomcat",
|
|
164 | 151 | "authentication" : "S3AccessCreds"
|
165 | 152 | },
|
166 | 153 | "/usr/share/tomcat6/manatee_dev.pem" : {
|
167 |
| - "source" : "https://s3.amazonaws.com/sea2shore/private/manatee_dev.pem", |
| 154 | + "source" : "https://s3.amazonaws.com/cd00creds/cd00.pem", |
168 | 155 | "mode" : "000600",
|
169 | 156 | "owner" : "tomcat",
|
170 | 157 | "group" : "tomcat",
|
|
192 | 179 | },
|
193 | 180 | "/etc/cron.hourly/jenkins_backup.sh" : {
|
194 | 181 | "content" : { "Fn::Join" : ["", [
|
195 |
| - "#!/bin/bash -v\n", |
| 182 | + "#!/bin/bash -v\n", |
| 183 | + "# Change into your jenkins home.\n", |
| 184 | + |
| 185 | + "cd /usr/share/tomcat6/.jenkins\n", |
196 | 186 |
|
197 |
| - "# Edit these values for your subversion repository\n", |
198 |
| - "svn_user=",{ "Ref" : "SvnID" },"\n", |
199 |
| - "svn_password=", { "Ref" : "SvnPassword" },"\n", |
200 |
| - |
201 |
| - "cd /usr/share/tomcat6/.jenkins\n", |
202 |
| - |
203 |
| - "svn add -q --parents *.xml jobs/*/config.xml users/*/config.xml userContent/\n", |
204 |
| - |
205 |
| - "# Ignore things we don't care about.\n", |
206 |
| - "cat > jobsignores <<EOF\n", |
207 |
| - "log\n", |
208 |
| - "*.log\n", |
209 |
| - "*.tmp\n", |
210 |
| - "*.old\n", |
211 |
| - "*.bak\n", |
212 |
| - "*.jar\n", |
213 |
| - ".*\n", |
214 |
| - "plugins/\n", |
215 |
| - "updates/\n", |
216 |
| - "jobs/*/builds\n", |
217 |
| - "jobs/*/last*\n", |
218 |
| - "jobs/*/next*\n", |
219 |
| - "jobs/*/*.csv\n", |
220 |
| - "jobs/*/*.txt\n", |
221 |
| - "jobs/*/*.log\n", |
222 |
| - "jobs/*/workspace\n", |
223 |
| - "EOF\n", |
| 187 | + "# Add any new conf files, jobs, users, and content.\n", |
| 188 | + "git add -f *.xml jobs/*/config.xml .gitignore\n", |
224 | 189 |
|
225 |
| - "svn propset svn:ignore -F jobsignores && rm jobsignores\n", |
| 190 | + "# Ignore things we don't care about\n", |
| 191 | + "cat > .gitignore <<EOF\n", |
| 192 | + "log\n", |
| 193 | + "*.log\n", |
| 194 | + "*.tmp\n", |
| 195 | + "*.old\n", |
| 196 | + "*.bak\n", |
| 197 | + "*.jar\n", |
| 198 | + ".*\n", |
| 199 | + "plugins/\n", |
| 200 | + "updates/\n", |
| 201 | + "jobs/*/builds\n", |
| 202 | + "jobs/*/last*\n", |
| 203 | + "jobs/*/next*\n", |
| 204 | + "jobs/*/*.csv\n", |
| 205 | + "jobs/*/*.txt\n", |
| 206 | + "jobs/*/*.log\n", |
| 207 | + "jobs/*/workspace\n", |
| 208 | + "EOF\n", |
226 | 209 |
|
227 |
| - "# Remove config that no longer exists\n", |
228 |
| - "svn status | grep '^!' | awk '{print $2;}' | xargs -r svn rm\n", |
229 |
| - |
230 |
| - "svn ci --non-interactive --username $svn_user --password $svn_password -m 'automated commit of Jenkins configuration'" |
| 210 | + "# Remove anything from git that no longer exists in jenkins.\n", |
| 211 | + "git status --porcelain | grep '^ D ' | awk '{print $2;}' | xargs -r git rm\n", |
| 212 | + |
| 213 | + "# And finally, commit and push\n", |
| 214 | + "git commit -m 'Automated commit of jenkins configuration' -a\n", |
| 215 | + "git push\n" |
231 | 216 | ]]},
|
232 | 217 | "mode" : "000500",
|
233 | 218 | "owner" : "root",
|
|
273 | 258 | " --region ", { "Ref" : "AWS::Region" }, " || error_exit 'Failed to run cfn-init'\n",
|
274 | 259 |
|
275 | 260 | "# Installing Ruby 1.9.3 from RPM\n",
|
276 |
| - "wget -P /home/ec2-user/ https://s3.amazonaws.com/sea2shore/resources/rpm/ruby-1.9.3p0-2.amzn1.x86_64.rpm\n", |
| 261 | + "wget -P /home/ec2-user/ https://s3.amazonaws.com/cdcourse/repo/ruby-1.9.3p0-2.amzn1.x86_64.rpm\n", |
277 | 262 | "rpm -Uvh /home/ec2-user/ruby-1.9.3p0-2.amzn1.x86_64.rpm\n",
|
278 | 263 |
|
279 | 264 | "# Install Bundler\n",
|
|
284 | 269 | "gem install capistrano --no-rdoc --no-ri\n",
|
285 | 270 |
|
286 | 271 | "rm -rf /usr/share/tomcat6/.jenkins\n",
|
287 |
| - "svn co http://subversion.assembla.com/svn/manatees/trunk/src/jenkins_config /usr/share/tomcat6/.jenkins --username ", { "Ref" : "SvnID" }, " --password ", { "Ref" : "SvnPassword" }, " --non-interactive\n", |
| 272 | + "git clone git@github.com:stelligent/continuous_integration_example.git /usr/share/tomcat6/.jenkins\n", |
288 | 273 |
|
289 | 274 | "# Pull down Jenkins Plugins\n",
|
290 | 275 | "wget -P /usr/share/tomcat6/.jenkins/plugins/ http://updates.jenkins-ci.org/download/plugins/s3/0.2.0/s3.hpi\n",
|
|
301 | 286 | "wget -P /usr/share/tomcat6/.jenkins/plugins/ http://updates.jenkins-ci.org/download/plugins/ssh-slaves/0.21/ssh-slaves.hpi\n",
|
302 | 287 | "wget -P /usr/share/tomcat6/.jenkins/plugins/ http://updates.jenkins-ci.org/download/plugins/translation/1.9/translation.hpi\n",
|
303 | 288 |
|
304 |
| - "cd /root\n", |
305 |
| - "wget https://s3.amazonaws.com/sea2shore/resources/binaries/grails-1.3.7.zip\n", |
306 |
| - "wget https://s3.amazonaws.com/sea2shore/resources/binaries/groovy-binary-1.8.2.zip\n", |
307 |
| - "unzip groovy-binary-1.8.2.zip\n", |
308 |
| - "unzip grails-1.3.7.zip\n", |
309 |
| - "mv groovy-1.8.2/ /usr/bin\n", |
310 |
| - "mv grails-1.3.7/ /usr/bin/\n", |
311 |
| - |
312 | 289 | "# Update main Jenkins config\n",
|
313 | 290 | "sed -i s@<accesskey>*</accessKey>@<accesskey>", { "Ref" : "HostKeys" }, "</accesskey>@ /usr/share/tomcat/.jenkins/hudson.plugins.s3.S3BucketPublisher.xml\n",
|
314 | 291 | "sed -i s@<secretKey>*</secretKey>@<secretKey>", {"Fn::GetAtt": ["HostKeys", "SecretAccessKey"]}, "</secretKey>@ /usr/share/tomcat/.jenkins/hudson.plugins.s3.S3BucketPublisher.xml\n",
|
|
0 commit comments