Skip to content

Commit 749617f

Browse files
committed
CI: use non-deprecated packer var for GCP creds
Hopefully this resolves: ``` + rake build:gcp config file contents: {"builders":[{"type":"googlecompute","account_file":"{\n \"type\": \"service_account\",\n \"project_id\": \"REDACTED\",\n \"private_key_id\": \"REDACTED\",\n \"private_key\": \"REDACTED",\n \"client_email\": \"REDACTED\",\n \"client_id\": \"REDACTED\",\n \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n \"token_uri\": \"https://oauth2.googleapis.com/token\",\n \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\n \"client_x509_cert_url\": \"REDACTED\"\n}","project_id":"REDACTED","tags":["winrm"],"source_image":"windows-server-2019-dc-core-v20241212","image_family":"windows-2019-core","zone":"us-east1-c","disk_size":32,"image_name":"packer-1735069447","machine_type":"n1-standard-4","omit_external_ip":false,"communicator":"winrm","winrm_username":"winrmuser","winrm_use_ssl":false,"winrm_timeout":"1h","state_timeout":"10m","metadata":{"sysprep-specialize-script-url":"https://raw.githubusercontent.com/cloudfoundry/bosh-windows-stemcell-builder/master/scripts/gcp/setup-winrm.ps1","name":"REDACTED"}}],"provisioners":[{"type":"file","source":"build/bosh-psmodules.zip","destination":"C:\\provision\\bosh-psmodules.zip","pause_before":"60s"},{"type":"file","source":"scripts/install-bosh-psmodules.ps1","destination":"C:\\provision\\install-bosh-psmodules.ps1","pause_before":"60s"},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","C:\\provision\\install-bosh-psmodules.ps1"],"pause_before":"60s"},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","New-Provisioner"]},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Remove-DockerPackage"]},{"type":"windows-restart","restart_timeout":"1h","check_registry":true},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Install-CFFeatures2016"]},{"type":"windows-restart","restart_timeout":"1h","check_registry":true},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Add-Account -User Provisioner -Password bbd102986fd686362af0!"]},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Register-WindowsUpdatesTask"]},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Wait-WindowsUpdates -Password bbd102986fd686362af0! -User Provisioner"]},{"type":"windows-restart","restart_timeout":"12h","check_registry":true},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Unregister-WindowsUpdatesTask"]},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Get-HotFix > hotfixes.log"]},{"type":"file","source":"hotfixes.log","destination":"hotfixes.log","direction":"download"},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Remove-Account -User Provisioner"]},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Protect-CFCell"]},{"type":"file","source":"../sshd/OpenSSH-Win64.zip","destination":"C:\\provision\\OpenSSH-Win64.zip"},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Install-SSHD -SSHZipFile 'C:\\provision\\OpenSSH-Win64.zip'"]},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Enable-SSHD"]},{"type":"file","source":"../lgpo-binary/LGPO_30/LGPO.exe","destination":"C:\\windows\\LGPO.exe"},{"type":"file","source":"build/agent.zip","destination":"C:\\provision\\agent.zip"},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Install-Agent -IaaS gcp -agentZipPath 'C:\\provision\\agent.zip' -EnableEphemeralDiskMounting"]},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","New-VersionFile -Version '2019.82.2-build.3'"]},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Disable-RC4"]},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Disable-TLS1"]},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Disable-TLS11"]},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Enable-TLS12"]},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Disable-3DES"]},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Get-WUCerts"]},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Remove-SSHKeys"]},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Clear-Provisioner"]},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Set-InternetExplorerRegistries"]},{"type":"powershell","inline":["$ErrorActionPreference = \"Stop\";","trap { $host.SetShouldExit(1) }","Invoke-Sysprep -IaaS gcp"]}]} packer build -machine-readable /tmp/20241224-335-rjni8r 1735069450,,ui,say,Warning: Warning when preparing build: "googlecompute"\n\naccount_file is deprecated%!(PACKER_COMMA) please use either credentials_json or\ncredentials_file instead\n\n ```
1 parent 04048ff commit 749617f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/packer/config/gcp.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def builders
1919
[
2020
{
2121
'type' => 'googlecompute',
22-
'account_file' => @account_json,
22+
'credentials_json' => @account_json,
2323
'project_id' => @project_id,
2424
'tags' => ['winrm'],
2525
'source_image' => @source_image,

spec/packer/config/gcp_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
let (:baseline_builders) { {
2525
'type' => 'googlecompute',
26-
'account_file' => 'some-account-json',
26+
'credentials_json' => 'some-account-json',
2727
'project_id' => 'some-project-id',
2828
'tags' => ['winrm'],
2929
'source_image' => 'some-source-image',

0 commit comments

Comments
 (0)