Automated packaging and publishing scripts on Git Linux __linux

Source: Internet
Author: User
#!/bin/bash home_dir= "/home/localadmin/" the "echo" Git folder is "$HOME _dir" Dzy-all "if [!-D $HOME _dir" Dzy-all "]; #如果不是一个文件夹 Then git config--global credential.helper store if [$#-ne 1]; Then echo "Usage:sudo./tomcat_update.sh branchname" Exit 0 fi git clone-b $ http://git.github.com /dzy_v3/dzy-all.git Dzy-all Else echo "Git folder already exists, release" fi tar_dir= "/usr/local/apache-tomcat-8.0.20" git_dir= $HOME _dir " dzy-all/"Bk_filename= $BK _dir"/dzy-all "' Date +%y%m%d%h%m%s '". tar.gz "publish_dir= $TAR _dir" WebApps "CD $TAR _dir CD Web Apps echo "Back up the original War package file" MV Dzy-web.war bk_dzy-web.tar.gz CD $GIT _dir echo is in the server pull substitution code ... "pwd GIT pull echo" is packing code ... "CD dzy-parent mvn clean install-dmaven.test.skip=true cd ..... /dzy-common mvn clean install-dmaven.test.skip=true CD. /dzy-data mvn clean install-dmaven.test.skip=true CD. /dzy-user mvn clean install-dmaven.test.skip=true CD. /dzy-module-parent mvn clean install-dmaven.test.skip=true CD. /dzy-pLatform mvn clean install-dmaven.test.skip=true echo "MVN Packaging code Complete ..." #rm_cmd = ' rm-rf ' $PUBLISH _dir '/* ' CD $TA R_dir #到tomcat里面去./bin/shutdown.sh echo "Wait 10 seconds ..." Sleep 10000 ' rm-rf $PUBLISH _dir/dzy-web* ' cp-r $HOME _di R "Dzy-all/target/dzy-web.war" $PUBLISH _dir ' echo ' Moves the war package complete ... ".
 /bin/start.sh echo "Tomcat boot complete ..."

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.