Skip to content

Commit

Permalink
Start creating script to automate preparing releases
Browse files Browse the repository at this point in the history
  • Loading branch information
ThetaSinner committed Dec 7, 2018
1 parent a20a3a0 commit 83db0b7
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions release.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
if (Test-Path -Path build) {
Remove-Item -Path build -Recurse
}
.\gradlew.bat build

$outFolder = 'es-release.prebuilt'
if (Test-Path -Path $outFolder) {
Remove-Item -Path $outFolder -Recurse
}
mkdir $outFolder
Copy-Item -Path .\build\libs\ebook-server-*-RELEASE.war -Destination $outFolder

Push-Location -Path ui
Remove-Item -Path build -Recurse
npm run build
Pop-Location
Copy-Item -Path .\ui\build -Destination $outFolder\ui -Recurse

if (-not (Get-Command Compress-7Zip -ErrorAction Ignore)) {
Install-Package -Scope CurrentUser 7Zip4PowerShell
}

$outTarPath = "$outFolder.tar"
if (Test-Path -Path $outTarPath) {
Remove-Item $outTarPath
}

$outTarGzipPath = "$outTarPath.gz"
if (Test-Path -Path $outTarGzipPath) {
Remove-Item $outTarGzipPath
}

Compress-7Zip -ArchiveFileName $outTarPath -Path $outFolder -Format Tar
Compress-7Zip -ArchiveFileName $outTarGzipPath -Path $outTarPath -Format GZip

Remove-Item $outTarPath
Remove-Item $outFolder -Recurse

0 comments on commit 83db0b7

Please sign in to comment.