forked from GCS-ZHN/AutoCard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
23 lines (21 loc) · 781 Bytes
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$appName="autocard"
mvn clean package spring-boot:repackage
if (!(Test-Path release)) {
mkdir release
}
if ((Get-ChildItem target/*.jar) -match "$appName-(.+?).jar") {
$version = $Matches[1]
$targetDir = "release/$appName-$version"
if ((Test-Path $targetDir)) {
Remove-Item -Recurse -Force $targetDir
}
if ((Test-Path "$targetDir.zip")) {
Remove-Item -Recurse -Force "$targetDir.zip"
}
mkdir $targetDir
Copy-Item -Path target/autocard-$version.jar -Destination $targetDir
Copy-Item templete/shutdown.sh.temp $targetDir/shutdown.sh
Copy-Item templete/startup.sh.temp $targetDir/startup.sh
Copy-Item -Recurse config $targetDir/config
Compress-Archive -LiteralPath $targetDir -DestinationPath "$targetDir.zip"
}