A simple dos script, svn get code, dossvn

Source: Internet
Author: User

A simple dos script, svn get code, dossvn
Get the latest code

svn update --username %SVN_USER% --password %SVN_PASSWORD% >> "../%LOG_FILE%"
Back up Tomcat sites
md "%APP_ROOT%\backup\%MVN_PROFILE%-%CUR_DATE%-%myran%" >> "%LOG_FILE%"xcopy "%APP_ROOT%\%MVN_PROFILE%" "%APP_ROOT%\backup\%MVN_PROFILE%-%CUR_DATE%-%myran%"/s >> "%LOG_FILE%"
Compile code

You must call the cmd cal command l. Otherwise, the maven command will exit the entire bat directly. This problem has been called for most of the night.

call mvn clean install -DskipTests -P %MVN_PROFILE% -f %MVN_POM% >>  "%LOG_FILE%" 
Stop tomcat Service
net stop  Tomcat6 >> "%LOG_FILE%"
Release site
rd /s/q "%APP_ROOT%\%MVN_PROFILE%" >> "%LOG_FILE%"md "%APP_ROOT%\%MVN_PROFILE%" >> "%LOG_FILE%"xcopy "%MVN_WEBAPP%\%MVN_PROFILE%" "%APP_ROOT%\%MVN_PROFILE%"/s >> "%LOG_FILE%"xcopy "%MVN_3RD_LIB%" "%APP_ROOT%\%MVN_PROFILE%\WEB-INF\lib" >> "%LOG_FILE%"
Start tomcat Service
net start  Tomcat6 >> "%LOG_FILE%"

Source code file

 


How to write a script? When SVN submits code, a prompt is given to the submitter.

Read-p "content:" variable
 
Help me write a simple dos batch processing script

How long is it? The following is the interval of one minute.

@ Echo off
: Sleep 100 s
Ping-n 100 127.1> nul
: 1
Ping-n 60 127.1> nul
Ping-n 1 xxx. xxx | findstr/c: "Request timed out"
Goto % errorlevel %
: 0
@ Echo on
2> nul
Ping-n 1 127.1> nul
2> nul
Ping-n 1 127.1> nul
2> nul
Ping-n 3 127.1> nul
@ Echo off
Shutdown-s-f-t 10-c "error, restart now"

Save the above as a bat file and place it in "start"> "start" to enable auto-start upon startup. Change xxx. xxx to the ip address you want to ping.

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.