release automation script

#!/bin/sh

if [ -z $PROJECT]; then
        PS3="Please choose:"
        PROJECTS="Project1 Project2"
        echo "Choose which project you want to build from the list below:"
        select PROJECT in $PROJECTS;
        do
                break
        done
fi

if [ -z $PROJECT ]; then
        echo "Error in select project!"
        exit
fi

echo "Release $PROJECT project now..."
case $PROJECT in
        Project1)
                export JAVA_HOME=/opt/jdk1.6.0_24
                xxx=aaa
                break;;
        Project2)
               export JAVA_HOME=/opt/jdk1.5.0_12
                xxx=bbb
                break;;
esac

echo "JAVA_HOME="$JAVA_HOME

read -p "Please enter your cvs user name: " yn
USER=`echo $yn|sed 's/ //g'`
if [ "$USER" = "" ]
then
        echo "Empty user name!"
        exit 1
fi

stty -echo
read -p "Please enter your cvs password:" PASS
stty echo
echo ""

 Release project is error-prone, so we should use scripts to make this progress automation. Here's an exmple for it (Only a part, not including mvn release process).

 

Tools can make our life easy!

 

你可能感兴趣的:(java,cvs)