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 Meteor /Meteorite, d3 and bootstrap. The deployment-data is coming out of a mongoDB. It's open-source under the apache-license and available at Github
$ 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
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":
{ _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" }
If you don't want to implement the reporting, you can install mongodb-clients and use something puppi and/or this script:
#!/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
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.
This is a demo-site for a deployment-browser which is probably one of the minor important parts of a Service Delivery Platform.
What is a Service Delivery Platform? from dev2ops.org on Vimeo
Here are other important possible building-blocks of your service-delivery-platform.
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.
Puppi is a deployment framework built with bash and provisioned with puppet. It can be used in numerous ways to fullfill your deployment-needs.An alternative might be e.g. capistrano.
Logstash can ship your logs towards an elasticsearch-backend and Kibana can help you to visualize them.
artifactory or nexus can store your artifacts and expose them again.
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 mcollective and/or ansible are very usefull.
There are reoccuring tasks in the development-space and you want to automate them. Jenkins is a good tool to do that.
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 zenboot to expose your scripts via a webinterface.