Adding all profiles creation in profile-creator.sh.

merge-requests/1/head
sinthuja 8 years ago
parent 12165fa996
commit 45d02838fe

@ -23,6 +23,8 @@
DIR="$(dirname "${BASH_SOURCE[0]}")" DIR="$(dirname "${BASH_SOURCE[0]}")"
DISTRIBUTION="wso2iot-@product.version@" DISTRIBUTION="wso2iot-@product.version@"
ALLPROF=0
BINDIR=$(pwd)
#get the desired profile #get the desired profile
echo "This tool will erase all the files which are not required for the selected profile " echo "This tool will erase all the files which are not required for the selected profile "
echo "and also creates a distribution of this profile in the same folder <IOT_HOME> resides." echo "and also creates a distribution of this profile in the same folder <IOT_HOME> resides."
@ -34,9 +36,12 @@ echo " 3.IoT Device Backend Profile"
echo " 4.IoT Device Manager Profile" echo " 4.IoT Device Manager Profile"
echo " 5.Analytics Profile" echo " 5.Analytics Profile"
echo " 6.Broker profile" echo " 6.Broker profile"
echo " 7.For All Profiles"
echo "Please enter the desired profile number to create the profile specific distribution." echo "Please enter the desired profile number to create the profile specific distribution."
read profileNumber read profileNumber
create_profile(){
echo "Creating profile - "${profileNumber}
if [ "$profileNumber" -lt 7 ] && [ "$profileNumber" -gt 0 ] ; then if [ "$profileNumber" -lt 7 ] && [ "$profileNumber" -gt 0 ] ; then
TEMPDIR=${DIR}/../../tmp TEMPDIR=${DIR}/../../tmp
@ -53,7 +58,7 @@ fi
#gateway profile #gateway profile
if [ ${profileNumber} -eq 1 ] if [ ${profileNumber} -eq 1 ]
then then
echo "Preparing the Integrator profile distribution" echo "Preparing the IoT Gateway profile distribution"
DEFAULT_BUNDLES="$(< ${DIR}/../wso2/components/http-gateway/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info)" DEFAULT_BUNDLES="$(< ${DIR}/../wso2/components/http-gateway/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info)"
#remove broker #remove broker
echo "Removing Broker profile" echo "Removing Broker profile"
@ -69,7 +74,7 @@ then
rm -rf ${DIR}/analytics.bat rm -rf ${DIR}/analytics.bat
rm -rf ${DIR}/analytics.sh rm -rf ${DIR}/analytics.sh
#remove integrator #remove iot
echo "Removing IoT Other profiles" echo "Removing IoT Other profiles"
rm -rf ${DIR}/../wso2/components/default ${DIR}/../wso2/components/device-backend ${DIR}/../wso2/components/device-key-manager ${DIR}/../wso2/components/device-manager rm -rf ${DIR}/../wso2/components/default ${DIR}/../wso2/components/device-backend ${DIR}/../wso2/components/device-key-manager ${DIR}/../wso2/components/device-manager
rm -rf ${DIR}/../samples/ rm -rf ${DIR}/../samples/
@ -90,7 +95,7 @@ then
#key-manager profile #key-manager profile
elif [ ${profileNumber} -eq 2 ] elif [ ${profileNumber} -eq 2 ]
then then
echo "Preparing the Integrator profile distribution" echo "Preparing the IoT Keymanager profile distribution"
DEFAULT_BUNDLES="$(< ${DIR}/../wso2/components/device-key-manager/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info)" DEFAULT_BUNDLES="$(< ${DIR}/../wso2/components/device-key-manager/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info)"
#remove broker #remove broker
echo "Removing Broker profile" echo "Removing Broker profile"
@ -106,7 +111,7 @@ then
rm -rf ${DIR}/analytics.bat rm -rf ${DIR}/analytics.bat
rm -rf ${DIR}/analytics.sh rm -rf ${DIR}/analytics.sh
#remove integrator #remove iot
echo "Removing IoT Other profiles" echo "Removing IoT Other profiles"
rm -rf ${DIR}/../wso2/components/default ${DIR}/../wso2/components/device-backend ${DIR}/../wso2/components/http-gateway ${DIR}/../wso2/components/device-manager rm -rf ${DIR}/../wso2/components/default ${DIR}/../wso2/components/device-backend ${DIR}/../wso2/components/http-gateway ${DIR}/../wso2/components/device-manager
rm -rf ${DIR}/../samples/ rm -rf ${DIR}/../samples/
@ -114,7 +119,7 @@ then
rm -rf ${DIR}/profile-creator.sh rm -rf ${DIR}/profile-creator.sh
rm -rf ${DIR}/profile-creator.bat rm -rf ${DIR}/profile-creator.bat
cp -rf ${DIR}/../repository/resources/profiles/keymanager/*.sh ${DIR}/../bin/ cp -rf ${DIR}/../repository/resources/profiles/keymanager/*.sh ${DIR}/../bin/
cp -rf ${DIR}/../repository/resources/profiles/gateway/carbon.xml ${DIR}/../conf/ cp -rf ${DIR}/../repository/resources/profiles/keymanager/carbon.xml ${DIR}/../conf/
rm -rf ${DIR}/../repository/deployment/server/jaggeryapps/* rm -rf ${DIR}/../repository/deployment/server/jaggeryapps/*
rm -rf ${DIR}/../repository/deployment/server/synapse-configs/default/api/* rm -rf ${DIR}/../repository/deployment/server/synapse-configs/default/api/*
rm -rf ${DIR}/../repository/deployment/server/synapse-configs/default/sequences/_*.xml rm -rf ${DIR}/../repository/deployment/server/synapse-configs/default/sequences/_*.xml
@ -134,7 +139,7 @@ then
#device backend profile #device backend profile
elif [ ${profileNumber} -eq 3 ] elif [ ${profileNumber} -eq 3 ]
then then
echo "Preparing the Integrator profile distribution" echo "Preparing the IoT Device Backend profile distribution"
DEFAULT_BUNDLES="$(< ${DIR}/../wso2/components/device-backend/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info)" DEFAULT_BUNDLES="$(< ${DIR}/../wso2/components/device-backend/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info)"
#remove broker #remove broker
echo "Removing Broker profile" echo "Removing Broker profile"
@ -150,7 +155,7 @@ then
rm -rf ${DIR}/analytics.bat rm -rf ${DIR}/analytics.bat
rm -rf ${DIR}/analytics.sh rm -rf ${DIR}/analytics.sh
#remove integrator #remove iot
echo "Removing IoT Other profiles" echo "Removing IoT Other profiles"
rm -rf ${DIR}/../wso2/components/default ${DIR}/../wso2/components/device-key-manager ${DIR}/../wso2/components/http-gateway ${DIR}/../wso2/components/device-manager rm -rf ${DIR}/../wso2/components/default ${DIR}/../wso2/components/device-key-manager ${DIR}/../wso2/components/http-gateway ${DIR}/../wso2/components/device-manager
rm -rf ${DIR}/../samples/ rm -rf ${DIR}/../samples/
@ -160,7 +165,7 @@ then
rm -rf ${DIR}/../repository/deployment/server/synapse-configs/default/api/* rm -rf ${DIR}/../repository/deployment/server/synapse-configs/default/api/*
rm -rf ${DIR}/../repository/deployment/server/synapse-configs/default/sequences/_*.xml rm -rf ${DIR}/../repository/deployment/server/synapse-configs/default/sequences/_*.xml
cp -rf ${DIR}/../repository/resources/profiles/backend/*.sh ${DIR}/../bin/ cp -rf ${DIR}/../repository/resources/profiles/backend/*.sh ${DIR}/../bin/
cp -rf ${DIR}/../repository/resources/profiles/gateway/carbon.xml ${DIR}/../conf/ cp -rf ${DIR}/../repository/resources/profiles/backend/carbon.xml ${DIR}/../conf/
rm -rf ${DIR}/../repository/deployment/server/webapps/oauth2.war ${DIR}/../repository/deployment/server/webapps/shindig.war ${DIR}/../repository/deployment/server/webapps/api#am#publisher#v0.11.war ${DIR}/../repository/deployment/server/webapps/api#am#store#v0.11.war ${DIR}/../repository/deployment/server/webapps/api#appm#oauth#v1.0.war ${DIR}/../repository/deployment/server/webapps/api#appm#publisher#v1.1.war ${DIR}/../repository/deployment/server/webapps/api#appm#store#v1.1.war rm -rf ${DIR}/../repository/deployment/server/webapps/oauth2.war ${DIR}/../repository/deployment/server/webapps/shindig.war ${DIR}/../repository/deployment/server/webapps/api#am#publisher#v0.11.war ${DIR}/../repository/deployment/server/webapps/api#am#store#v0.11.war ${DIR}/../repository/deployment/server/webapps/api#appm#oauth#v1.0.war ${DIR}/../repository/deployment/server/webapps/api#appm#publisher#v1.1.war ${DIR}/../repository/deployment/server/webapps/api#appm#store#v1.1.war
rm -rf ${DIR}/../repository/deployment/server/webapps/dynamic-client-web.war ${DIR}/../repository/deployment/server/webapps/client-registration#v0.11.war rm -rf ${DIR}/../repository/deployment/server/webapps/dynamic-client-web.war ${DIR}/../repository/deployment/server/webapps/client-registration#v0.11.war
rm -rf ${DIR}/../repository/deployment/server/jaggeryapps/* rm -rf ${DIR}/../repository/deployment/server/jaggeryapps/*
@ -172,7 +177,7 @@ then
#device manager profile #device manager profile
elif [ ${profileNumber} -eq 4 ] elif [ ${profileNumber} -eq 4 ]
then then
echo "Preparing the Integrator profile distribution" echo "Preparing the IoT Device Manager profile distribution"
DEFAULT_BUNDLES="$(< ${DIR}/../wso2/components/device-manager/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info)" DEFAULT_BUNDLES="$(< ${DIR}/../wso2/components/device-manager/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info)"
#remove broker #remove broker
echo "Removing Broker profile" echo "Removing Broker profile"
@ -188,7 +193,7 @@ then
rm -rf ${DIR}/analytics.bat rm -rf ${DIR}/analytics.bat
rm -rf ${DIR}/analytics.sh rm -rf ${DIR}/analytics.sh
#remove integrator #remove iot
echo "Removing IoT Other profiles" echo "Removing IoT Other profiles"
rm -rf ${DIR}/../wso2/components/default ${DIR}/../wso2/components/device-key-manager ${DIR}/../wso2/components/http-gateway ${DIR}/../wso2/components/device-backend rm -rf ${DIR}/../wso2/components/default ${DIR}/../wso2/components/device-key-manager ${DIR}/../wso2/components/http-gateway ${DIR}/../wso2/components/device-backend
rm -rf ${DIR}/../samples/ rm -rf ${DIR}/../samples/
@ -196,7 +201,7 @@ then
rm -rf ${DIR}/profile-creator.sh rm -rf ${DIR}/profile-creator.sh
rm -rf ${DIR}/profile-creator.bat rm -rf ${DIR}/profile-creator.bat
cp -rf ${DIR}/../repository/resources/profiles/manager/*.sh ${DIR}/../bin/ cp -rf ${DIR}/../repository/resources/profiles/manager/*.sh ${DIR}/../bin/
cp -rf ${DIR}/../repository/resources/profiles/gateway/carbon.xml ${DIR}/../conf/ cp -rf ${DIR}/../repository/resources/profiles/manager/carbon.xml ${DIR}/../conf/
mkdir ${DIR}/../repository/deployment/server/tempwebapp mkdir ${DIR}/../repository/deployment/server/tempwebapp
cp ${DIR}/../repository/deployment/server/webapps/api#am#publisher#v0.11.war ${DIR}/../repository/deployment/server/tempwebapp/ cp ${DIR}/../repository/deployment/server/webapps/api#am#publisher#v0.11.war ${DIR}/../repository/deployment/server/tempwebapp/
cp ${DIR}/../repository/deployment/server/webapps/api#am#store#v0.11.war ${DIR}/../repository/deployment/server/tempwebapp/ cp ${DIR}/../repository/deployment/server/webapps/api#am#store#v0.11.war ${DIR}/../repository/deployment/server/tempwebapp/
@ -258,7 +263,7 @@ then
rm -rf ${DIR}/analytics.bat rm -rf ${DIR}/analytics.bat
rm -rf ${DIR}/analytics.sh rm -rf ${DIR}/analytics.sh
#remove integrator #remove iot
echo "Removing IoT profiles" echo "Removing IoT profiles"
rm -rf ${DIR}/../conf rm -rf ${DIR}/../conf
rm -rf ${DIR}/../wso2/components/default ${DIR}/../wso2/components/device-backend ${DIR}/../wso2/components/device-key-manager ${DIR}/../wso2/components/device-manager ${DIR}/../wso2/components/http-gateway rm -rf ${DIR}/../wso2/components/default ${DIR}/../wso2/components/device-backend ${DIR}/../wso2/components/device-key-manager ${DIR}/../wso2/components/device-manager ${DIR}/../wso2/components/http-gateway
@ -299,6 +304,21 @@ echo "Preparing a profile distribution archive."
cd ${DIR}/../../ cd ${DIR}/../../
mv ${DISTRIBUTION} ${DISTRIBUTION}${PROFILE} mv ${DISTRIBUTION} ${DISTRIBUTION}${PROFILE}
zip -r ${DISTRIBUTION}${PROFILE}.zip ${DISTRIBUTION}${PROFILE}/ zip -r ${DISTRIBUTION}${PROFILE}.zip ${DISTRIBUTION}${PROFILE}/
cd ${BINDIR}
DIR=${BINDIR}
echo "Profile created successfully in "$(pwd)"/"${DISTRIBUTION}${PROFILE} echo "Profile created successfully in "$(pwd)"/"${DISTRIBUTION}${PROFILE}
}
if [ ${profileNumber} -eq 7 ]; then
profileNumber=1
while [ "$profileNumber" -lt 7 ]
do
create_profile
((profileNumber++))
done
echo "All profiles are created successfully!"
else
create_profile
fi
exit 0 exit 0

Loading…
Cancel
Save