Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 30 additions & 14 deletions assets/packer/virtual-workstations/shared/base_infrastructure.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -237,20 +237,36 @@ try {

# Install Chocolatey package manager
Write-Host "Installing Chocolatey package manager..."
try {
[System.Net.ServicePointManager]::SecurityProtocol = 3072
Set-ExecutionPolicy Bypass -Scope Process -Force
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

# Chocolatey will be available in PATH after installation

# Configure Chocolatey for faster installations
choco feature enable -n allowGlobalConfirmation
choco feature disable -n showDownloadProgress

Write-Host "Chocolatey installed successfully"
} catch {
Write-Host "Chocolatey installation failed: $_" -ForegroundColor Yellow
$maxRetries = 3
$retryCount = 0
$chocolateyInstalled = $false

while (-not $chocolateyInstalled -and $retryCount -lt $maxRetries) {
try {
$retryCount++
Write-Host "Chocolatey installation attempt $retryCount of $maxRetries..."
[System.Net.ServicePointManager]::SecurityProtocol = 3072
Set-ExecutionPolicy Bypass -Scope Process -Force
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

# Chocolatey will be available in PATH after installation

# Configure Chocolatey for faster installations
choco feature enable -n allowGlobalConfirmation
choco feature disable -n showDownloadProgress

Write-Host "Chocolatey installed successfully"
$chocolateyInstalled = $true
} catch {
Write-Host "Chocolatey installation attempt $retryCount failed: $_" -ForegroundColor Yellow
if ($retryCount -lt $maxRetries) {
Write-Host "Waiting 30 seconds before retry..." -ForegroundColor Yellow
Start-Sleep -Seconds 30
} else {
Write-Host "Chocolatey installation failed after $maxRetries attempts" -ForegroundColor Red
throw "Chocolatey installation failed: $_"
}
}
}

# Install common development tools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,14 @@ build {
script = "../shared/sysprep.ps1"
}

# Clean restart before sysprep
provisioner "windows-restart" {
restart_timeout = "5m"
}

# Run sysprep and shutdown
# Run sysprep and shutdown - no restart needed
provisioner "powershell" {
elevated_user = "Administrator"
elevated_password = build.Password
inline = [
"Write-Host 'Starting sysprep for UE GameDev VDI AMI...'",
"Start-Process -FilePath \"$${env:ProgramFiles}\\Amazon\\EC2Launch\\ec2launch.exe\" -ArgumentList 'sysprep', '--shutdown' -WindowStyle Hidden -Wait:$false",
"Start-Sleep -Seconds 5"
"C:\\Windows\\System32\\Sysprep\\sysprep.exe /generalize /oobe /shutdown /unattend:C:\\ProgramData\\Amazon\\EC2Launch\\sysprep2008.xml"
]
}
}
4 changes: 2 additions & 2 deletions modules/perforce/modules/p4-code-review/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,12 @@ resource "aws_ecs_task_definition" "task_definition" {
EOF
]

secrets = [
secrets = var.config_php_source != null ? [
{
name = "CONFIG_USER_PHP"
valueFrom = var.config_php_source
},
]
] : []
environment = [
{
name = "CONFIG_PHP"
Expand Down