-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclone-meta-repos.ps1
More file actions
35 lines (30 loc) · 1.04 KB
/
clone-meta-repos.ps1
File metadata and controls
35 lines (30 loc) · 1.04 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
#!/usr/bin/env pwsh
# clone-meta-repos.ps1 — Clone all 6 meta repos into C:\IT-Stack\it-stack-dev\repos\meta\
$meta = "C:\IT-Stack\it-stack-dev\repos\meta"
$org = "it-stack-dev"
$repos = @(
"it-stack-docs",
"it-stack-installer",
"it-stack-testing",
"it-stack-ansible",
"it-stack-terraform",
"it-stack-helm"
)
Write-Host "Cloning meta repos into $meta..." -ForegroundColor Cyan
Set-Location $meta
foreach ($repo in $repos) {
if (Test-Path "$meta\$repo") {
Write-Host " [SKIP] $repo (already exists)" -ForegroundColor DarkYellow
} else {
Write-Host " Cloning $repo..." -ForegroundColor Gray
git clone "https://github.com/$org/$repo.git" 2>&1 | Out-Null
if ($LASTEXITCODE -eq 0) {
Write-Host " [OK] $repo" -ForegroundColor Green
} else {
Write-Host " [FAIL] $repo" -ForegroundColor Red
}
}
}
Write-Host ""
Write-Host "Repos cloned to: $meta" -ForegroundColor Yellow
Get-ChildItem $meta -Directory | Select-Object Name | Format-Table -HideTableHeaders