-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush-phase1-repos.ps1
More file actions
43 lines (34 loc) · 1.42 KB
/
push-phase1-repos.ps1
File metadata and controls
43 lines (34 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env pwsh
# push-phase1-repos.ps1 — Init, commit, and push all 5 Phase 1 scaffolded repos to GitHub
$org = "it-stack-dev"
$modules = @(
@{ Repo = "it-stack-freeipa"; Dir = "C:\IT-Stack\it-stack-dev\repos\01-identity" }
@{ Repo = "it-stack-keycloak"; Dir = "C:\IT-Stack\it-stack-dev\repos\01-identity" }
@{ Repo = "it-stack-postgresql"; Dir = "C:\IT-Stack\it-stack-dev\repos\02-database" }
@{ Repo = "it-stack-redis"; Dir = "C:\IT-Stack\it-stack-dev\repos\02-database" }
@{ Repo = "it-stack-traefik"; Dir = "C:\IT-Stack\it-stack-dev\repos\07-infrastructure" }
)
foreach ($m in $modules) {
$path = Join-Path $m.Dir $m.Repo
Write-Host ""
Write-Host "==> $($m.Repo)" -ForegroundColor Cyan
Set-Location $path
# Init git
git init -b main 2>&1 | Out-Null
# Set remote
git remote remove origin 2>&1 | Out-Null
git remote add origin "https://github.com/$org/$($m.Repo).git"
# Stage all
git add -A
# Commit
git commit -m "feat: initial scaffold — standard IT-Stack module structure" 2>&1 | Out-Null
# Force push (repo was created with auto-README)
$result = git push --force origin main 2>&1
if ($LASTEXITCODE -eq 0) {
Write-Host " [OK] Pushed to github.com/$org/$($m.Repo)" -ForegroundColor Green
} else {
Write-Host " [FAIL] $result" -ForegroundColor Red
}
}
Write-Host ""
Write-Host "Done." -ForegroundColor Yellow