29 lines
958 B
PowerShell
29 lines
958 B
PowerShell
# LevelCraft Plugin Deploy Script
|
|
param(
|
|
[switch]$UsePassword,
|
|
[string]$Password = $null
|
|
)
|
|
|
|
Write-Host "LevelCraft Plugin Deployment" -ForegroundColor Green
|
|
Write-Host "="*40 -ForegroundColor Green
|
|
|
|
if ($UsePassword) {
|
|
if (!$Password) {
|
|
$SecurePassword = Read-Host "Server Password" -AsSecureString
|
|
$Password = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecurePassword))
|
|
}
|
|
|
|
Write-Host "Using password authentication..." -ForegroundColor Yellow
|
|
$env:SERVER_PASSWORD = $Password
|
|
./gradlew uploadPlugin
|
|
Remove-Item Env:SERVER_PASSWORD -ErrorAction SilentlyContinue
|
|
} else {
|
|
Write-Host "Using SSH key authentication..." -ForegroundColor Yellow
|
|
./gradlew uploadPlugin
|
|
}
|
|
|
|
if ($LASTEXITCODE -eq 0) {
|
|
Write-Host "`nDeployment successful! ✅" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "`nDeployment failed! ❌" -ForegroundColor Red
|
|
} |