Created
December 23, 2020 22:00
-
-
Save megalucio/6ff7813e9b8fcb02fa514c71eda94b1a to your computer and use it in GitHub Desktop.
Script to compile and deploy maven generated war file into servlets container.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
[ "$UID" -eq 0 ] || exec sudo "$0" "$@" | |
export DESTINATION=/usr/share/tomcat/webapps | |
export WAR_NAME=mywebapp | |
export WAR_EXTENSION=war.original | |
export MAVEN_HOME=~/apache-maven-3.5.4 | |
export SERVICE_NAME=tomcat | |
set -x #echo on | |
set -e #exit on error | |
service $SERVICE_NAME stop | |
$MAVEN_HOME/bin/mvn clean package -DskipTests=true | |
rm -rf $DESTINATION/$WAR_NAME | |
cp target/$WAR_NAME.$WAR_EXTENSION $DESTINATION/$WAR_NAME.war | |
service $SERVICE_NAME start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment