#!/bin/sh
#
DATE=`date +%m%d%H%M `
DIR="/var/lib/jenkins/jobs/nginx/workspace"
sudo /bin/docker build -t nginx_$DATE $DIR | tee $DIR/Docker_build_result.log
RESULT=$(cat $DIR/Docker_build_result.log | tail -n 1)
if [["$RESULT" != *Successfully*]];then
exit -1
fi