You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by ev...@apache.org on 2005/08/02 13:01:43 UTC
svn commit: r226983 - /maven/continuum/trunk/ci_continuum.sh
Author: evenisse
Date: Tue Aug 2 04:01:20 2005
New Revision: 226983
URL: http://svn.apache.org/viewcvs?rev=226983&view=rev
Log:
Add a little ci script for maven zone
Added:
maven/continuum/trunk/ci_continuum.sh (with props)
Added: maven/continuum/trunk/ci_continuum.sh
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/ci_continuum.sh?rev=226983&view=auto
==============================================================================
--- maven/continuum/trunk/ci_continuum.sh (added)
+++ maven/continuum/trunk/ci_continuum.sh Tue Aug 2 04:01:20 2005
@@ -0,0 +1,170 @@
+#!/bin/sh
+
+# ----------------------------------------------------------------------------------
+
+. $HOME/.profile
+cd $HOME
+
+CMD=$1
+
+[ "$1" = "" ] && echo && echo "You must specify a checkout or update!" && echo && exit 1
+
+FROM=continuum@maven.zones.apache.org
+TO=continuum-dev@maven.apache.org
+DATE=`date`
+
+PID=$$
+RUNNING=`ps -ef | grep ci_continuum.sh | grep -v 'sh -c' | grep -v grep | grep -v $PID`
+if [ ! -z "$RUNNING" ]; then
+ if [ "$CMD" = "checkout" ]; then
+ echo "From: $FROM" > running_log
+ echo "To: $TO" >> running_log
+ echo "Subject: [continuum build - SKIPPED - $CMD] $DATE" >>running_log
+ echo "" >> running_log
+ echo "ci_continuum.sh already running... exiting" >>running_log
+ echo "$RUNNING" >>running_log
+ /usr/sbin/sendmail -t < running_log
+ fi
+ exit 1
+fi
+
+HOME_DIR=`pwd`
+DIR=$HOME/continuum-build
+REPO=$HOME_DIR/maven-repo-local
+SCM_LOG=scm.log
+TIMESTAMP=`date +%Y%m%d.%H%M%S`
+WWW=$HOME/public_html
+DEPLOY_DIR=$WWW/builds
+DEPLOY_SITE=http://maven.zones.apache.org/~continuum/builds
+DIST=m2-${TIMESTAMP}.tar.gz
+SVN=svn
+
+M2_HOME=$HOME/m2
+export M2_HOME
+PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin
+export PATH
+
+MESSAGE_DIR=$WWW/logs
+MESSAGE_NAME=continuum-build-log-${TIMESTAMP}.txt
+MESSAGE=${MESSAGE_DIR}/${MESSAGE_NAME}
+
+mkdir -p $DEPLOY_DIR
+mkdir -p $MESSAGE_DIR
+
+# ----------------------------------------------------------------------------------
+
+# Wipe out the working directory and the repository and start entirely
+# from scratch.
+
+# ----------------------------------------------------------------------------------
+
+BUILD_REQUIRED=false
+if [ -f $HOME_DIR/build_required ]; then
+ BUILD_REQUIRED=`cat $HOME_DIR/build_required`
+fi
+
+if [ ! -d $DIR/maven-components ]; then
+ CMD="checkout"
+fi
+
+(
+ if [ "$CMD" = "checkout" ]
+ then
+
+ rm -rf $DIR > /dev/null 2>&1
+
+ mkdir $DIR
+
+ rm -rf $REPO > /dev/null 2>&1
+
+ mkdir $REPO
+
+ echo
+ echo "Performing a clean check out of continuum ..."
+ echo
+
+ (
+ cd $DIR
+
+ $SVN co http://svn.apache.org/repos/asf/maven/continuum/trunk continuum > $HOME_DIR/$SCM_LOG 2>&1
+
+ echo "true" > $HOME_DIR/build_required
+ )
+
+ else
+
+ echo
+ echo "Performing an update of continuum ..."
+ echo
+
+ (
+ cd $DIR/continuum
+
+ $SVN update > $HOME_DIR/$SCM_LOG 2>&1
+
+ grep "^[PUAD] " $HOME_DIR/$SCM_LOG > /dev/null 2>&1
+
+ if [ "$?" = "1" ]
+ then
+
+ echo $BUILD_REQUIRED > $HOME_DIR/build_required
+
+ else
+
+ echo "true" > $HOME_DIR/build_required
+
+ fi
+
+ )
+
+ fi
+
+ BUILD_REQUIRED=`cat $HOME_DIR/build_required`
+
+ if [ "$BUILD_REQUIRED" = "true" ]
+ then
+
+ echo "Updates occured, build required ..."
+ echo
+ grep "^[PUAD] " $HOME_DIR/$SCM_LOG
+ echo
+
+ (
+ cd $DIR/continuum
+
+ sh build.sh -Dmaven.repo.local="$REPO" -Dmaven.home="$M2_HOME"
+ ret=$?; if [ $ret != 0 ]; then exit $ret; fi
+ )
+ ret=$?; if [ $ret != 0 ]; then exit $ret; fi
+
+ else
+
+ echo "No updates occured, no build required. Done."
+
+ fi
+
+) >> $MESSAGE 2>&1
+ret=$?
+
+BUILD_REQUIRED=`cat $HOME_DIR/build_required`
+
+# Only send mail to the list if a build was required.
+
+host=`hostname`
+
+if [ "$BUILD_REQUIRED" = "true" ]
+then
+ echo "From: $FROM" > log
+ echo "To: $TO" >> log
+ if [ $ret != 0 ]; then
+ echo "Subject: [continuum build - FAILED - $CMD] $DATE" >> log
+ else
+ echo "Subject: [continuum build - SUCCESS - $CMD] $DATE" >> log
+ rm $HOME_DIR/build_required
+ fi
+ echo "" >> log
+ echo "Log:" >> log
+ echo "http://maven.zones.apache.org/~continuum/logs/${MESSAGE_NAME}" >> log
+
+ /usr/sbin/sendmail -t < log
+fi
Propchange: maven/continuum/trunk/ci_continuum.sh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/continuum/trunk/ci_continuum.sh
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"