Skip to content

Instantly share code, notes, and snippets.

@mefarazath
Last active December 8, 2016 07:49
Show Gist options
  • Save mefarazath/bc98c315d9c5960f73f0794883127558 to your computer and use it in GitHub Desktop.
Save mefarazath/bc98c315d9c5960f73f0794883127558 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
notify-send "Building C5 framework"
FRAMEWORK="/home/farazath/IS/identity-framework"
FRAMEWORK_BRANCH="C5-Framework_PoC"
PRODUCT_IS="/home/farazath/IS/product-is"
PRODUCT_IS_BRANCH="C5-framework_PoC"
POC="/home/farazath/Desktop/framework_PoC"
PACK=$POC/wso2is-6.0.0-SNAPSHOT
#
# To run the script :
# sh deploy.sh
#
# Debug Mode
# sh deploy.sh debug <port>
#
#
cd $FRAMEWORK
git checkout ${FRAMEWORK_BRANCH}
mvn clean install
if [ $? -ne 0 ]
then
notify-send "Framework Build Failed !!!" ; sleep 10 ; killall notify-osd
exit 1
else
notify-send "Framework Built Successfully !!!" ; sleep 3 ; killall notify-osd
fi
notify-send "Building Product-IS"
cd ${PRODUCT_IS}/product
git checkout ${PRODUCT_IS_BRANCH}
mvn clean install
if [ $? -ne 0 ]
then
notify-send "Build failed at Product-IS !!!" ; sleep 10 ; killall notify-osd
exit 1
else
notify-send "C5 Product-IS Built Successfully !!!" ; sleep 5 ; killall notify-osd
fi
echo "copy pack...."
cp ${PRODUCT_IS}/product/target/wso2is-6.0.0-SNAPSHOT.zip $POC
echo "remove old pack...."
rm -r ${PACK}
echo "Unzip new pack"
cd $POC
unzip wso2is-6.0.0-SNAPSHOT.zip
cp $POC/scripts/log4j2.xml $PACK/conf/
# remove authentication interceptor : this is temporary until MSF4J is fixed.
rm -r $PACK/osgi/plugins/org.wso2.carbon.identity.mgt.login.interceptor_1.0.0.SNAPSHOT.jar
cd ${PACK}
cd ${PACK}/bin
debug="debug"
if [ "$1" = "$debug" ] ;
then
notify-send "Product IS is waiting in debug mode...."
sh carbon.sh -debug "$2"
else
notify-send "Product IS is starting up...."
sh carbon.sh
fi
long job ; notify-send "Pack is up"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment