#!/bin/sh DEPLOY_PATH=$DEPLOY_TARGET_LOCATION IS_ELASTIC=%PRIVATE__SUPORTELASTIC% #IS_ELASTIC='false'; if [ !$IS_ELASTIC ] || [ $IS_ELASTIC = true ]; then APPLICATION_URL=$PRIVATE__DOWNLOAD_FILE_URL fi if [ $IS_ELASTIC = false ]; then APPLICATION_URL=%PRIVATE__APPLICATION_URL% fi if [ ! $APPLICATION_URL ]; then echo "in deploy tomcat script the APPLICATION_URL is empty" exit fi if [ ! $DEPLOY_PATH ]; then echo "the deploy path is empty" DEPLOY_PATH="/usr/local/tomcat/webapps" fi #analyze %PRIVATE__APPLICATION_URL% arr=(${APPLICATION_URL//\// }) length=${#arr[@]} PRIVATE__APPLICATION_PACKAGE_NAME=${arr[$length - 1]} echo "deploy path " $DEPLOY_PATH echo "application name " $PRIVATE__APPLICATION_PACKAGE_NAME remove_file=${PRIVATE__APPLICATION_PACKAGE_NAME%.*} cd $DEPLOY_PATH rm -rf remove_file* rm -rf docs examples host-manager manager wget -O $PRIVATE__APPLICATION_PACKAGE_NAME $APPLICATION_URL file_type=${PRIVATE__APPLICATION_PACKAGE_NAME##*.} echo "file type is " $file_type if [ $file_type = "gz" ] then echo "unzip tool tar......." tar -zxf $PRIVATE__APPLICATION_PACKAGE_NAME elif [ $file_type = "tar" ] then echo "unzip tool tar......." tar -xf $PRIVATE__APPLICATION_PACKAGE_NAME elif [ $file_type = "zip" ] then echo "unzip tool nuzip ......." unzip -o $PRIVATE__APPLICATION_PACKAGE_NAME elif [ $file_type == "war" ] then echo "war......." fi
部署tomcat脚本
最新推荐文章于 2022-01-27 17:29:22 发布