adoptium / infrastructure

This repo contains all information about machine maintenance.
Apache License 2.0
84 stars 100 forks source link

WinPB: Update Wix Installation To Install SDK #3624

Closed steelhead31 closed 6 days ago

steelhead31 commented 6 days ago

Update the Wix5 installation task, as the .NET SDK is not installed by default, and the wix installation requires it.

This also addresses a bug, where the playbook incorrectly uses sudo as a become method, which should be runas in Windows.

Fixes #3617

Checklist
gdams commented 6 days ago

I've just been chatting to the .NET team, there are dotnet-install scripts you can use. For example:

# Windows PowerShell
Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile "$env:temp/dotnet-install.ps1"; powershell -executionpolicy bypass "$env:temp/dotnet-install.ps1"

# PowerShell Core
Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile "$env:temp/dotnet-install.ps1"; pwsh "$env:temp/dotnet-install.ps1"

This would prevent us having to update the checksum etc

steelhead31 commented 6 days ago

I've just been chatting to the .NET team, there are dotnet-install scripts you can use. For example:

# Windows PowerShell
Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile "$env:temp/dotnet-install.ps1"; powershell -executionpolicy bypass "$env:temp/dotnet-install.ps1"

# PowerShell Core
Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile "$env:temp/dotnet-install.ps1"; pwsh "$env:temp/dotnet-install.ps1"

I tried those, but they install the .net SDK in a user specific folder, which then isn't available to the jenkins user.. as we run the playbooks as an administrator user, but these tools are needed for the jenkins user.

gdams commented 6 days ago

I've just been chatting to the .NET team, there are dotnet-install scripts you can use. For example:

# Windows PowerShell
Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile "$env:temp/dotnet-install.ps1"; powershell -executionpolicy bypass "$env:temp/dotnet-install.ps1"

# PowerShell Core
Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile "$env:temp/dotnet-install.ps1"; pwsh "$env:temp/dotnet-install.ps1"

I tried those, but they install the .net SDK in a user specific folder, which then isn't available to the jenkins user.. as we run the playbooks as an administrator user, but these tools are needed for the jenkins user.

Can you not run them as the jenkins user?

steelhead31 commented 6 days ago

I've just been chatting to the .NET team, there are dotnet-install scripts you can use. For example:

# Windows PowerShell
Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile "$env:temp/dotnet-install.ps1"; powershell -executionpolicy bypass "$env:temp/dotnet-install.ps1"

# PowerShell Core
Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile "$env:temp/dotnet-install.ps1"; pwsh "$env:temp/dotnet-install.ps1"

I tried those, but they install the .net SDK in a user specific folder, which then isn't available to the jenkins user.. as we run the playbooks as an administrator user, but these tools are needed for the jenkins user.

Can you not run them as the jenkins user?

Let me give them a quick test. I had issues with the become user elements on our playbook checker ( its on an old version of ansible which has issues... that's a separate issue Im already looking into )

steelhead31 commented 6 days ago

I've tried running both as jenkins, as it doesn't get added to the path, it ends up in a <>/.dotnet folder, I think the current solution is more reliable, so I'll leave it like this, as it does work with GHA, and when running the playbooks to build normal machines.