docs: project docs, scripts, deployment configs, and evidence
This commit is contained in:
35
scripts/dev/init-admin-local.ps1
Normal file
35
scripts/dev/init-admin-local.ps1
Normal file
@@ -0,0 +1,35 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$Username,
|
||||
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$Password,
|
||||
|
||||
[string]$Email = '',
|
||||
|
||||
[switch]$ResetPassword
|
||||
)
|
||||
|
||||
$repoRoot = (Resolve-Path (Join-Path $PSScriptRoot '..\..')).Path
|
||||
$cacheRoot = Join-Path $repoRoot '.cache\go'
|
||||
$buildCache = Join-Path $repoRoot '.cache\go-build'
|
||||
$modCache = Join-Path $cacheRoot 'pkg\mod'
|
||||
|
||||
New-Item -ItemType Directory -Force $cacheRoot, $buildCache, $modCache | Out-Null
|
||||
|
||||
$env:GOPATH = $cacheRoot
|
||||
$env:GOCACHE = $buildCache
|
||||
$env:GOMODCACHE = $modCache
|
||||
$env:UMS_ADMIN_USERNAME = $Username
|
||||
$env:UMS_ADMIN_PASSWORD = $Password
|
||||
$env:UMS_ADMIN_EMAIL = $Email
|
||||
$env:UMS_ADMIN_RESET_PASSWORD = if ($ResetPassword.IsPresent) { 'true' } else { 'false' }
|
||||
|
||||
Push-Location $repoRoot
|
||||
try {
|
||||
& go run .\tools\init_admin.go
|
||||
} finally {
|
||||
Pop-Location
|
||||
}
|
||||
Reference in New Issue
Block a user