-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.ps1
More file actions
62 lines (54 loc) · 2.1 KB
/
deploy.ps1
File metadata and controls
62 lines (54 loc) · 2.1 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# deploy.ps1 — Sync i66.org command files and website to S3
# Usage: .\deploy.ps1 [-DryRun]
param(
[switch]$DryRun
)
$Bucket = "s3://i66.org"
$DryRunArg = if ($DryRun) { "--dryrun" } else { $null }
if ($DryRun) { Write-Host ">>> DRY RUN — no files will be uploaded <<<" -ForegroundColor Yellow }
# Verify AWS CLI is available
if (-not (Get-Command aws -ErrorAction SilentlyContinue)) {
Write-Error "AWS CLI not found. Install from https://aws.amazon.com/cli/"
exit 1
}
Write-Host "Target bucket: $Bucket" -ForegroundColor Cyan
Write-Host ""
# ── 1. Sync command files (text/plain) ───────────────────────────────────────
Write-Host "▶ Syncing command files (text/plain)..." -ForegroundColor Green
$syncArgs = @(
"s3", "sync", ".", $Bucket,
"--exclude", "*",
"--include", "aws/*",
"--include", "azure/*",
"--include", "gcp/*",
"--include", "sys/*",
"--include", "net/*",
"--include", "ssl/*",
"--include", "docker/*",
"--include", "k8s/*",
"--include", "git/*",
"--include", "helm/*",
"--include", "terraform/*",
"--include", "db/*",
"--include", "redis/*",
"--include", "nginx/*",
"--include", "vault/*",
"--include", "cpucredits",
"--include", "aws-cli-describe-stack-resources",
"--content-type", "text/plain; charset=utf-8",
"--cache-control", "no-cache, no-store, must-revalidate"
)
if ($DryRunArg) { $syncArgs += $DryRunArg }
& aws @syncArgs
# ── 2. Upload HTML files (text/html) ─────────────────────────────────────────
Write-Host "▶ Uploading HTML files (text/html)..." -ForegroundColor Green
$htmlArgs = @(
"--content-type", "text/html; charset=utf-8",
"--cache-control", "no-cache, no-store, must-revalidate"
)
if ($DryRunArg) { $htmlArgs += $DryRunArg }
& aws s3 cp llms.txt "$Bucket/llms.txt" @htmlArgs
& aws s3 cp index.html "$Bucket/index.html" @htmlArgs
& aws s3 cp error.html "$Bucket/error.html" @htmlArgs
Write-Host ""
Write-Host "✓ Deploy complete → http://i66.org" -ForegroundColor Cyan