forked from ssssssss-team/magic-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.bat
44 lines (37 loc) · 974 Bytes
/
action.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
@echo off
:: 需要配置环境变量,使得 mvn 可以在命令行中使用
set env=%~2
if "%env%"=="" (
set env=dev
)
IF "%~1"=="package" (
goto :package
) ELSE IF "%~1"=="install" (
goto :install
) ELSE IF "%~1"=="deploy" (
goto :deploy
) ELSE IF "%~1"=="set_version" (
goto :set_version
) ELSE (
echo "************************************************"
echo "Usage: action.bat {package|install|clean|deploy|set_version}"
echo "************************************************"
exit /b -1
)
:package
echo "package %env%"
mvn clean package -U -DskipTests=true -Dmaven.javadoc.skip=true -P%env%
exit
:install
echo "install %env%"
mvn clean install -U -DskipTests=true -Dmaven.javadoc.skip=true -P%env%
exit
:deploy
echo "deploy %env%"
mvn clean deploy -U -DskipTests=true -Dmaven.javadoc.skip=true -P%env%
exit
:set_version
set version=%~2
echo "set_version %version%"
mvn versions:set -DgenerateBackupPoms=false -DnewVersion="%version%"
exit