#!/bin/bash --login
DIR=$(cd $(dirname "$0"); pwd)

# Create environment
$DIR/set_env.sh

cd $WORKSPACE/repo
rvm use 2.1.2
bundle exec berks up

#!/bin/bash --login
DIR=$(cd $(dirname "$0"); pwd)

# Create environment
$DIR/set_env.sh

cd $WORKSPACE/repo
rvm use 2.1.2
bundle exec berks up
if [ $? == 0 ];
then
  VERSION=`cat $WORKSPACE/repo/metadata.rb | grep -m1 version | sed 's/'\''//g' | awk '{print "v"$2}'`
  COOKBOOK=`cat $WORKSPACE/repo/metadata.rb | grep -m1 name | sed 's/'\''//g' | cut -d ' ' -f2`
  # Write log to Elasticsearch via logstash for Grafana annotations
  echo "{ \"type\": \"chef-deploy\", \"cookbook\": \"${COOKBOOK}\", \"version\": ${VERSION}\" }'" | nc -q1 -u 127.0.0.1 5228
fi

Add logging of chef deploys to logstash
Add logging of chef deploys to logstash
