Improve deployment script (add file hash as sanity check).
This commit is contained in:
parent
688e8f0e13
commit
40abb405e9
@ -1,2 +1,2 @@
|
|||||||
@echo off
|
@echo off
|
||||||
xcopy /s/e/y target\*.jar %~dp0\ripme.jar
|
powershell -c ".\deploy.ps1 -source (Join-Path target (Get-Item -Path .\target\* -Filter *.jar)[0].Name) -dest ripme.jar"
|
||||||
|
16
deploy.ps1
Normal file
16
deploy.ps1
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
Param (
|
||||||
|
[Parameter(Mandatory=$True)]
|
||||||
|
[string]$source,
|
||||||
|
[Parameter(Mandatory=$True)]
|
||||||
|
[string]$dest
|
||||||
|
)
|
||||||
|
|
||||||
|
Copy-Item -Path $source -Destination $dest
|
||||||
|
|
||||||
|
$sourceHash = (Get-FileHash $source -algorithm MD5).Hash
|
||||||
|
$destHash = (Get-FileHash $dest -algorithm MD5).Hash
|
||||||
|
if ($sourceHash -eq $destHash) {
|
||||||
|
Write-Output 'Deployed successfully.'
|
||||||
|
} else {
|
||||||
|
Write-Output 'Hash Mismatch: did you close ripme before deploying?'
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user