Skip to content

Commit

Permalink
fix: puppet agent url + split version per dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
jpatigny authored Sep 2, 2024
1 parent 1216c8d commit e2a09c3
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 4 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 30 additions & 0 deletions puppet/dockerfile6
Original file line number Diff line number Diff line change
@@ -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" ]
4 changes: 2 additions & 2 deletions puppet/dockerfile → puppet/dockerfile8
Original file line number Diff line number Diff line change
Expand Up @@ -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 ; \
Expand Down

0 comments on commit e2a09c3

Please sign in to comment.