diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 56ec421..f398f18 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,12 +22,22 @@ jobs: - image: puppet os: windows-2019 base: ltsc2019 - file: dockerfile + file: dockerfile6 version_match: PUPPET_AGENT_VERSION - image: puppet os: windows-2022 base: ltsc2022 - file: dockerfile + file: dockerfile6 + version_match: PUPPET_AGENT_VERSION + - image: puppet + os: windows-2019 + base: ltsc2019 + file: dockerfile8 + version_match: PUPPET_AGENT_VERSION + - image: puppet + os: windows-2022 + base: ltsc2022 + file: dockerfile8 version_match: PUPPET_AGENT_VERSION steps: - name: Checkout diff --git a/puppet/dockerfile6 b/puppet/dockerfile6 new file mode 100644 index 0000000..54e623c --- /dev/null +++ b/puppet/dockerfile6 @@ -0,0 +1,30 @@ +ARG BASE + +FROM mcr.microsoft.com/windows/servercore:${BASE} + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'Continue'; $verbosePreference='Continue';"] + +COPY ./puppet/helpers.ps1 C:/temp/helpers.ps1 + +ARG PUPPET_AGENT_VERSION=6.28.0 +ARG PDK_VERSION=3.2.0.1 +ARG RUBY_VERSION=3.3.4-1 + +RUN Set-ItemProperty 'HKLM:\System\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1 ; \ + $client = New-Object System.Net.WebClient ; \ + $client.DownloadFile(\"https://downloads.puppetlabs.com/windows/puppet/pdk-$($env:PDK_VERSION)-x64.msi\",\"C:\temp\pdk-$($env:PDK_VERSION)-x64.msi\") ; \ + $client.DownloadFile(\"https://downloads.puppetlabs.com/windows/puppet6/puppet-agent-$($env:PUPPET_AGENT_VERSION)-x64.msi\",\"C:\temp\puppet-agent-$($env:PUPPET_AGENT_VERSION)-x64.msi\") ; \ + $client.DownloadFile(\"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-$($env:RUBY_VERSION)/rubyinstaller-$($env:RUBY_VERSION)-x64.exe\",\"C:\temp\rubyinstaller.exe\") ; \ + . C:\temp\helpers.ps1 ; \ + Install-MSI "C:\temp\puppet-agent-$($env:PUPPET_AGENT_VERSION)-x64.msi" ; \ + Install-MSI "C:\temp\pdk-$($env:PDK_VERSION)-x64.msi" ; \ + & C:\temp\rubyinstaller.exe /verysilent /currentuser ; \ + Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force ; \ + Install-Module -Name Pester -Force -SkipPublisherCheck ; \ + [System.Environment]::SetEnvironmentVariable('PDK_DISABLE_ANALYTICS', 'true', [EnvironmentVariableTarget]::Machine) + +RUN gem install librarian-puppet -v 5.0.0 ; \ + Remove-Item C:\temp -Force -Recurse + +WORKDIR C:/puppet +CMD [ "powershell.exe", "-NoLogo" ] diff --git a/puppet/dockerfile b/puppet/dockerfile8 similarity index 92% rename from puppet/dockerfile rename to puppet/dockerfile8 index 5daf421..69c7809 100644 --- a/puppet/dockerfile +++ b/puppet/dockerfile8 @@ -6,13 +6,13 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref COPY ./puppet/helpers.ps1 C:/temp/helpers.ps1 -ARG PUPPET_AGENT_VERSION=6.28.0 +ARG PUPPET_AGENT_VERSION=8.6.0 ARG PDK_VERSION=3.2.0.1 ARG RUBY_VERSION=3.3.4-1 RUN Set-ItemProperty 'HKLM:\System\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1 ; \ $client = New-Object System.Net.WebClient ; \ - $client.DownloadFile(\"https://downloads.puppetlabs.com/windows/puppet8/pdk-$($env:PDK_VERSION)-x64.msi\",\"C:\temp\pdk-$($env:PDK_VERSION)-x64.msi\") ; \ + $client.DownloadFile(\"https://downloads.puppetlabs.com/windows/puppet/pdk-$($env:PDK_VERSION)-x64.msi\",\"C:\temp\pdk-$($env:PDK_VERSION)-x64.msi\") ; \ $client.DownloadFile(\"https://downloads.puppetlabs.com/windows/puppet8/puppet-agent-$($env:PUPPET_AGENT_VERSION)-x64.msi\",\"C:\temp\puppet-agent-$($env:PUPPET_AGENT_VERSION)-x64.msi\") ; \ $client.DownloadFile(\"https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-$($env:RUBY_VERSION)/rubyinstaller-$($env:RUBY_VERSION)-x64.exe\",\"C:\temp\rubyinstaller.exe\") ; \ . C:\temp\helpers.ps1 ; \