Skip to content

Commit

Permalink
Merge branch 'release/3.0.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
Gildas Cherruel committed May 18, 2016
2 parents 2b6b7ea + d4c227d commit 2ac9265
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 11 deletions.
8 changes: 7 additions & 1 deletion scripts/Backup-Logs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,15 @@ process
exit 2
}

$log_dir = (Join-Path $log_dir "${env:PACKER_BUILDER_TYPE}-${env:PACKER_BUILD_NAME}-$(Get-Date -Format 'yyyyMMddHHmmss')")
While (! (Test-Path $log_dir))
{
Write-Output "Waiting for shares to be available"
Start-Sleep 20
}
$log_dir = Join-Path $log_dir "${env:PACKER_BUILDER_TYPE}-${env:PACKER_BUILD_NAME}-$(Get-Date -Format 'yyyyMMddHHmmss')"
if (! (Test-Path $log_dir)) { New-Item -ItemType Directory -Path $log_dir -ErrorAction Stop | Out-Null }

Write-Output "Backing up logs in $log_dir"
if (Test-Path "C:\ProgramData\chocolatey\logs\chocolatey.log")
{
if ($PSCmdlet.ShouldProcess("chocolatey.log", "Backing up"))
Expand Down
12 changes: 9 additions & 3 deletions scripts/disable-update.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
$mgr = New-Object -ComObject Microsoft.Update.ServiceManager -Strict
$mgr.ClientApplicationID = "packer"
$mgr.RemoveService('7971f918-a847-4430-9279-4a52d1efe18d')
$WindowsUpdateKey = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update"

$Update_Never = 1
$Update_Check = 2
$Update_Download = 3
$Update_Auto = 4

Set-ItemProperty -Path $WindowsUpdateKey -Name AUOptions -Value $Update_Never -Force -Confirm:$false
Set-ItemProperty -Path $WindowsUpdateKey -Name CachedAUOptions -Value $Update_Never -Force -Confirm:$false
8 changes: 7 additions & 1 deletion scripts/mount-iso.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ process
}
$ShareArgs['Credential'] = New-Object System.Management.Automation.PSCredential($ShareInfo.User, (ConvertTo-SecureString -String $ShareInfo.Password -AsPlainText -Force))
}
$Drive = New-PSDrive -Name $ShareInfo.DriveLetter -Root $ShareInfo.Path @ShareArgs
$Drive = New-PSDrive -Name $ShareInfo.DriveLetter -Root $ShareInfo.Path @ShareArgs -Persist -Scope Global
$share_dir = $Drive.Root
}
else
Expand Down Expand Up @@ -87,6 +87,12 @@ process
}
Write-Verbose "Found: $InstallISO"

While (! (Test-Path $share_dir))
{
Write-Output "Waiting for shars to be available"
Start-Sleep 20
}

if ([string]::IsNullOrEmpty($DriveLetter))
{
Write-Verbose "Searching for the last unused drive letter"
Expand Down
3 changes: 2 additions & 1 deletion scripts/prep-share.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ process
Write-Output "$Share from $Server will be used with $DriveLetter and connected as $User"
if ($PSCmdlet.ShouldProcess($DriveLetter, "Mounting ${Server}\${Share}"))
{
Write-Verbose "Testing connection information"
Write-Output "Testing connection information"
$Drive = New-PSDrive -Name $DriveLetter -PSProvider FileSystem -Root \\${Server}\${Share} -Credential (New-Object System.Management.Automation.PSCredential("${Server}\${User}", (ConvertTo-SecureString -String $Password -AsPlainText -Force))) -ErrorAction Stop
$ShareInfo['DriveLetter'] = $DriveLetter
$ShareInfo['Path'] = "\\${Server}\${Share}"
$ShareInfo['User'] = "${Server}\${User}";
$ShareInfo['Password'] = $Password
Write-Output "connection information: name=${$Drive.Name}, root=${$Drive.Root} (${$Drive.displayRoot}), provider=${$Drive.Provider}, description=${$Drive.Description}"
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion templates/cic/packer.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
},
{
"type": "parallels-iso",
"vm_name": "packer_{{user `template`}}",
"vm_name": "packer_cic",
"guest_os_type": "win-2012",
"iso_urls": [
"{{user `cache_dir`}}/9600.16384.WINBLUE_RTM.130821-1623_X64FRE_SERVER_EVAL_EN-US-IRM_SSS_X64FREE_EN-US_DV5.ISO",
Expand Down Expand Up @@ -268,6 +268,7 @@
{ "type": "powershell", "inline": [ "Copy-Item C:/ProgramData/BGInfo/Set-Background.lnk \"C:/ProgramData/Microsoft/Windows/Start Menu/Programs/StartUp\"" ] },
{ "type": "powershell", "script": "./scripts/Set-AccountPicture.ps1" },
{ "type": "powershell", "script": "./scripts/install-vmhost-additions.ps1" },
{ "type": "powershell", "inline": [ "Install-WindowsFeature -Name Net-Framework-Core -Source D:\\sources\\sxs" ], "elevated_user": "vagrant", "elevated_password": "vagrant" },
{ "type": "windows-restart", "except": [ "hyperv-iso" ] },

{ "type": "powershell", "script": "./scripts/install-chocolatey.ps1" },
Expand Down
3 changes: 2 additions & 1 deletion templates/windows-10-enterprise-eval/packer.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
},
{
"type": "parallels-iso",
"vm_name": "packer_{{user `template`}}",
"vm_name": "packer_win10",
"guest_os_type": "win-2012",
"iso_urls": [
"{{user `cache_dir`}}/10240.16384.150709-1700.TH1_CLIENTENTERPRISEEVAL_OEMRET_X64FRE_EN-US.ISO",
Expand Down Expand Up @@ -219,6 +219,7 @@
{ "type": "file", "source": "./data/vagrant.jpg", "destination": "C:/Users/vagrant/Pictures/vagrant.jpg" },
{ "type": "powershell", "script": "./scripts/Set-AccountPicture.ps1" },
{ "type": "powershell", "script": "./scripts/install-vmhost-additions.ps1" },
{ "type": "powershell", "inline": [ "Install-WindowsFeature -Name Net-Framework-Core -Source D:\\sources\\sxs" ], "elevated_user": "vagrant", "elevated_password": "vagrant" },
{ "type": "windows-restart" },

{ "type": "powershell", "script": "./scripts/enable-update.ps1", "elevated_user": "vagrant", "elevated_password": "vagrant" },
Expand Down
3 changes: 2 additions & 1 deletion templates/windows-2012R2-core-standard-eval/packer.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
},
{
"type": "parallels-iso",
"vm_name": "packer_{{user `template`}}",
"vm_name": "packer_windows2012R2",
"guest_os_type": "win-2012",
"iso_urls": [
"{{user `cache_dir`}}/9600.16384.WINBLUE_RTM.130821-1623_X64FRE_SERVER_EVAL_EN-US-IRM_SSS_X64FREE_EN-US_DV5.ISO",
Expand Down Expand Up @@ -251,6 +251,7 @@
{ "type": "file", "source": "./data/GeoTrust_Global_CA.pem", "destination": "C:/Windows/Temp/GeoTrust_Global_CA.pem" },
{ "type": "powershell", "script": "./scripts/config-shell.ps1" },
{ "type": "powershell", "script": "./scripts/install-vmhost-additions.ps1" },
{ "type": "powershell", "inline": [ "Install-WindowsFeature -Name Net-Framework-Core -Source D:\\sources\\sxs" ], "elevated_user": "vagrant", "elevated_password": "vagrant" },
{ "type": "windows-restart", "except": [ "hyperv-iso" ] },

{ "type": "powershell", "script": "./scripts/install-chocolatey.ps1" },
Expand Down
3 changes: 2 additions & 1 deletion templates/windows-2012R2-full-standard-eval/packer.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
},
{
"type": "parallels-iso",
"vm_name": "packer_{{user `template`}}",
"vm_name": "packer_win2012R2",
"guest_os_type": "win-2012",
"iso_urls": [
"{{user `cache_dir`}}/9600.16384.WINBLUE_RTM.130821-1623_X64FRE_SERVER_EVAL_EN-US-IRM_SSS_X64FREE_EN-US_DV5.ISO",
Expand Down Expand Up @@ -254,6 +254,7 @@
{ "type": "powershell", "inline": [ "Copy-Item C:/ProgramData/BGInfo/Set-Background.lnk \"C:/ProgramData/Microsoft/Windows/Start Menu/Programs/StartUp\"" ] },
{ "type": "powershell", "script": "./scripts/Set-AccountPicture.ps1" },
{ "type": "powershell", "script": "./scripts/install-vmhost-additions.ps1" },
{ "type": "powershell", "inline": [ "Install-WindowsFeature -Name Net-Framework-Core -Source D:\\sources\\sxs" ], "elevated_user": "vagrant", "elevated_password": "vagrant" },
{ "type": "windows-restart", "except": [ "hyperv-iso" ] },

{ "type": "powershell", "script": "./scripts/install-chocolatey.ps1" },
Expand Down
3 changes: 2 additions & 1 deletion templates/windows-8.1-enterprise-eval/packer.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
},
{
"type": "parallels-iso",
"vm_name": "packer_{{user `template`}}",
"vm_name": "packer_win8.1",
"guest_os_type": "win-8",
"iso_urls": [
"{{user `cache_dir`}}/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_ENTERPRISE_EVAL_EN-US-IR3_CENA_X64FREE_EN-US_DV9.ISO",
Expand Down Expand Up @@ -248,6 +248,7 @@
{ "type": "file", "source": "./data/vagrant.jpg", "destination": "C:/Users/vagrant/Pictures/vagrant.jpg" },
{ "type": "powershell", "script": "./scripts/Set-AccountPicture.ps1" },
{ "type": "powershell", "script": "./scripts/install-vmhost-additions.ps1" },
{ "type": "powershell", "inline": [ "Install-WindowsFeature -Name Net-Framework-Core -Source D:\\sources\\sxs" ], "elevated_user": "vagrant", "elevated_password": "vagrant" },
{ "type": "windows-restart" },

{ "type": "powershell", "script": "./scripts/install-chocolatey.ps1" },
Expand Down

0 comments on commit 2ac9265

Please sign in to comment.