-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathabout.html
232 lines (188 loc) · 8.83 KB
/
about.html
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<head>
<title>meteor-deployments</title>
</head>
<body>
</body>
<template name="about">
<div class="container-fluid" id="info">
{{> info}}
{{> sdp}}
{{> other_stuff}}
<hr>
<footer>
<p>© <a href="https://twitter.com/k9ert">k9ert</a> 2013</p>
</footer>
</div>
</template>
<template name="info">
<div class="row-fluid">
<div class="span12">
<div class="hero-unit">
<h1>Deployment Browser</h1>
<p>You have lots of applications in lots of versions and you deploy
them in lots of environments?! How do keep track of all the difference
deployments? This is where this deployment-browser comes into play.
It's based on <a href="http://meteor.com/">Meteor</a>
/<a href="https://github.com/oortcloud/meteorite">Meteorite</a>,
<a href="http://d3js.org/">d3</a>
and <a href="http://twitter.github.io/bootstrap/">bootstrap</a>.
The deployment-data is coming out of a mongoDB. It's open-source under the apache-license and available at
<a href="https://github.com/k9ert/meteor-deployments">Github</a></p>
<h2>Installation</h2>
</p>Here is how to install the browser:</p>
<pre>
$ apt-get install nodejs npm
$ sudo -H npm install -g meteorite
$ git clone https://github.com/k9ert/meteor-deployments.git
$ cd meteor-deployments
# connect to your
$ export MONGO_URL=mongodb://somemongodb.somedomain.com:27017/deployments
$ mrt
</pre>
<h2>Deployment-Reporting</h2>
<p>In order to get Data in your MongoDB, you either do your own and push Data like this in the collection "deployments" in a database called "deployments":</p>
<pre>
{
_id: ObjectId("50bc72d875331f9b9d398c25"),
ts: ISODate("2012-12-03T09:37:28%:z"),
result: "OK",
fqdn: "int2-udp1.somedomain.com",
project: "udp.ui.web",
source: "https://repository.somedomain.com/release/com/somedomain/udp/udp-ui-web",
tag: "20121203-043703",
version: "0.4.0",
artifact: "udp-ui-web",
warfile: "udp-ui-web-0.4.0.war",
environment: "int2"
}
</pre>
<p>If you don't want to implement the reporting, you can install mongodb-clients and use something puppi and/or this script:
<pre>
#!/bin/bash
set +x
# report_mongodb.sh - Made for Puppi
# This script sends a summary to a mongodb defined in $1
# e.g. somemongohost/dbname
# Sources common header for Puppi scripts
. $(dirname $0)/header || exit 10
if [ "$EXITCRIT" = "1" ] ; then
proposed_exit=2
fi
if [ "$EXITWARN" = "1" ] ; then
proposed_exit=1
fi
# check prerequisites
mongo -version > /dev/null
if [ $? -ne 0 ]; then
echo "mongo-client is not installed, aborting"
exit $proposed_exit
fi
fqdn=$(facter fqdn)
environment=$(facter environment -p)
# something like mongodb://someuser:hispassword@somehost/somedb
mongourl=$1
if [[ ! $mongourl =~ "mongodb://" ]]; then
echo "WARNING: mongourl invalid! Please use a valid monurl!"
exit $proposed_exit
fi
if [[ $mongourl =~ @ ]]; then
# ok we have to deal with passwords
# you HAVE to provide a password if you provide a user
mongodb=`echo $mongourl | sed 's/.*@//'`
mongouser=`echo $mongourl | sed 's/mongodb:\/\///' | sed 's/:.*//' `
mongopassword=`echo $mongourl | sed 's/mongodb:\/\///' | sed 's/[^:]*://' | sed 's/@.*//' `
mongoarguments="--username $mongouser --password $mongopassword"
else
mongodb=`echo $mongourl | sed 's/mongodb:\/\///'`
fi
result=$(grep result $logdir/$project/$tag/summary | awk '{ print $NF }')
summary=$(cat $logdir/$project/$tag/summary)
mcmd="db.deployments.insert({ts:new Date(),result:\"${result}\",fqdn:\"${fqdn}\",project:\"${project}\",source:\"${source}\",tag:\"${tag}\",version:\"${version}\",artifact:\"${artifact}\",testmode:\"${testmode}\",warfile:\"${warfile}\",environment:\"${environment}\"}); quit(0)"
mongo $mongoarguments $mongodb --eval "$mcmd"
# Now do a reporting to enable "most-recent-versions on all servers"
read -r -d '' mcmd <<'EOF'
var map = function() {
project=this.project ;
emit( this.fqdn +":"+ this.project, {project:this.project, fqdn:this.fqdn, ts:this.ts,version:this.version,environment:this.environment} );
};
var reduce = function(k,vals) {
result = vals[0];
vals.forEach(function(val) { if (val.ts > result.ts) result=val } ) ;
return result;
};
db.deployments.mapReduce(
map,
reduce,
{out:{replace:"versions"}})
EOF
mongo $mongoarguments $mongodb --eval "$mcmd"
exit $proposed_exit
</pre>
<p>This script is part of puppi, which is a bash framework for deployments provisioned
by puppet. If you don't want to use puppi, it's probably easy to modify it approriately.</p>
</div>
</div><!--/row-->
</div><!--/span-->
</div><!--/row-->
</template>
<template name="sdp">
<div class="row-fluid">
<div class="span12">
<div class="hero-unit">
<p>This is a demo-site for a deployment-browser which is probably one of the minor important
parts of a Service Delivery Platform.</p>
<iframe src="http://player.vimeo.com/video/46125904" width="500" height="375" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe> <p><a href="http://vimeo.com/46125904">What is a Service Delivery Platform?</a> from <a href="http://vimeo.com/dev2ops">dev2ops.org</a> on <a href="http://vimeo.com">Vimeo</a></p>
<p>Here are other important possible building-blocks of your service-delivery-platform.
</div><!--/row-->
</div><!--/span-->
</div><!--/row-->
</template>
<template name="other_stuff">
<div class="row-fluid">
<div class="span3">
<h2>Provisioning</h2>
<p>Puppet is a Provisioning tool to automate the installation of your servers. If you're in hurry and want to avoid
the puppetmaster-infrastructure, you might want to use ansible for provisioning. </p>
<p><a class="btn" href="https://puppetlabs.com/puppet/what-is-puppet/">Learn more »</a></p>
</div><!--/span-->
<div class="span3">
<h2>Deployment</h2>
<p>Puppi is a deployment framework built with bash and provisioned with puppet. It can be used in
<a href="https://groups.google.com/forum/?fromgroups#!topic/example42-puppet-modules/aI0WVNqaweY">numerous ways</a>
to fullfill your deployment-needs.An alternative might be e.g.
<a href="https://github.com/capistrano/capistrano">capistrano</a>.</p>
<p><a class="btn" href="http://www.example42.com/?q=Puppi_A_Puppet_module_for_Deployment_Automation">Learn more »</a></p>
</div><!--/span-->
<div class="span3">
<h2>Log-aggregation</h2>
<p>Logstash can ship your logs towards an elasticsearch-backend and Kibana
can help you to visualize them.</p>
<p><a class="btn" href="http://spredzy.wordpress.com/2013/01/25/powerful-analysis-tool-using-logstash-elasticsearch-kibana/">Learn more »</a></p>
</div><!--/span-->
<div class="span3">
<h2>artifact-repository</h2>
<p><a href="http://www.jfrog.com/home/v_artifactory_opensource_overview">artifactory</a>
or <a href="http://www.sonatype.org/nexus/">nexus</a> can store your artifacts and expose them again.</p>
<p><a class="btn" href="http://blog.sonatype.com/people/2009/04/what-is-a-repository/">Learn more »</a></p>
</div><!--/span-->
</div>
<div class="row-fluid">
<div class="span3">
<h2>Orchestration</h2>
<p>There are always things which need to be done on your servers, maybe in an orchestrated way.
Deployments, maintenance-tasks or implementing worakrounds for urgent issues on more than one server.
For such stuff <a href="https://puppetlabs.com/mcollective/introduction/">mcollective</a> and/or <a href="http://ansible.cc/">ansible</a> are very usefull.</p>
</div><!--/span-->
<div class="span3">
<h2>Continous Integration</h2>
<p>There are reoccuring tasks in the development-space and you want to automate them. Jenkins is a good tool to do that.</p>
<p><a class="btn" href="https://wiki.jenkins-ci.org/display/JENKINS/Meet+Jenkins">Learn more »</a></p>
</div><!--/span-->
<div class="span3">
<h2>Expose scripts</h2>
<p>If you have use mcollective and or ansible, you're probably happy to have something automated. However, an automation is even more valuable if they can be executed by
someone who is NOT able to use ssh. Use <a href="https://github.com/hybris/zenboot">zenboot</a> to expose your scripts via a webinterface.</p>
</div><!--/span-->
</div>
</div>
</template>