Skip to content

Commit 090d2d3

Browse files
authored
Merge branch 'actions:main' into main
2 parents 206abc3 + 2742bac commit 090d2d3

File tree

88 files changed

+2070
-2946
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+2070
-2946
lines changed

.github/workflows/create_pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
run: |
1919
git checkout ${{ github.event.client_payload.ReleaseBranchName }}
2020
git branch ${{ github.event.client_payload.ReleaseBranchName }}-docs
21-
git push origin ${{ github.event.client_payload.ReleaseBranchName }}-docs
21+
git push origin ${{ github.event.client_payload.ReleaseBranchName }}-docs --force
2222
2323
- name: Create pull request for ${{ github.event.client_payload.ReleaseBranchName }}
2424
id: create-pr

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ To build a VM machine from this repo's source, see the [instructions](docs/creat
2222
| --------------------|---------------------|--------------------|--------------------|
2323
| Ubuntu 24.04 | `ubuntu-latest` or `ubuntu-24.04` | [ubuntu-24.04] | ![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fsubir0071%2F385e39188f4280878bada99250e99db7%2Fraw%2Fubuntu24.json) |
2424
| Ubuntu 22.04 | `ubuntu-22.04` | [ubuntu-22.04] | ![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fsubir0071%2F385e39188f4280878bada99250e99db7%2Fraw%2Fubuntu22.json) |
25-
| Ubuntu 20.04 | `ubuntu-20.04` | [ubuntu-20.04] | ![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fsubir0071%2F385e39188f4280878bada99250e99db7%2Fraw%2Fubuntu20.json) |
25+
| Ubuntu 20.04 <sup>deprecated</sup> | `ubuntu-20.04` | [ubuntu-20.04] | ![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fsubir0071%2F385e39188f4280878bada99250e99db7%2Fraw%2Fubuntu20.json) |
2626
| macOS 15 <sup>beta</sup> | `macos-15-large`| [macOS-15] | ![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fsubir0071%2F385e39188f4280878bada99250e99db7%2Fraw%2Fmacos-15.json) |
2727
| macOS 15 Arm64 <sup>beta</sup> | `macos-15` or `macos-15-xlarge` | [macOS-15-arm64] | ![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fsubir0071%2F385e39188f4280878bada99250e99db7%2Fraw%2Fmacos-15-arm64.json) |
2828
| macOS 14 | `macos-latest-large` or `macos-14-large`| [macOS-14] | ![Endpoint Badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fsubir0071%2F385e39188f4280878bada99250e99db7%2Fraw%2Fmacos-14.json) |

docs/create-image-and-azure-resources.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ In any case, you will need these software installed:
7575
## Manual image generation
7676

7777
This repository includes a script that assists in generating images in Azure.
78-
All you need is an Azure subscription and a build agent configured as described above.
78+
All you need is an Azure subscription, a resource group in that subscription and a build agent configured as described above.
7979
We suggest starting with building the UbuntuMinimal image because it includes only basic software and builds in less than 30 minutes.
8080

8181
All the commands below should be executed in PowerShell.
@@ -96,7 +96,8 @@ Import-Module .\helpers\GenerateResourcesAndImage.ps1
9696
Finally, run the `GenerateResourcesAndImage` function, setting the mandatory arguments: image type and where to build and store the resulting managed image:
9797

9898
- `SubscriptionId` - your Azure Subscription ID;
99-
- `ResourceGroupName` - the name of the resource group that will be created within your subscription (e.g., "imagegen-test");
99+
- `ResourceGroupName` - the name of the resource group that will store the resulting artifact (e.g., "imagegen-test").
100+
The resource group must already exist in your Azure subscription;
100101
- `AzureLocation` - the location where resources will be created (e.g., "East US");
101102
- `ImageType` - the type of image to build (we suggest choosing "UbuntuMinimal" here; other valid options are "Windows2019", "Windows2022", "Windows2025", "Ubuntu2004", "Ubuntu2204", "Ubuntu2404").
102103

@@ -195,9 +196,10 @@ you can use Packer directly. To do this, you will need:
195196
- a resource group created in your Azure subscription where the managed image will be stored;
196197
- a string to be used as a password for the user used to install software (Windows only).
197198

198-
Then, you can invoke Packer in your CI/CD pipeline using the following command:
199+
Then, you can invoke Packer in your CI/CD pipeline using the following commands:
199200

200201
```powershell
202+
packer plugins install github.com/hashicorp/azure 2.2.1
201203
packer build -var "subscription_id=$SubscriptionId" `
202204
-var "client_id=$ClientId" `
203205
-var "client_secret=$ClientSecret" `

helpers/GenerateResourcesAndImage.ps1

Lines changed: 3 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Function GenerateResourcesAndImage {
8383
.PARAMETER SubscriptionId
8484
The Azure subscription id where the Azure resources will be created.
8585
.PARAMETER ResourceGroupName
86-
The name of the resource group to create the Azure resources in.
86+
The name of the resource group to store the resulting artifact. Resource group must already exist.
8787
.PARAMETER ImageType
8888
The type of image to generate. Valid values are: Windows2019, Windows2022, Windows2025, Ubuntu2004, Ubuntu2204, Ubuntu2404, UbuntuMinimal.
8989
.PARAMETER ManagedImageName
@@ -103,12 +103,6 @@ Function GenerateResourcesAndImage {
103103
.PARAMETER RestrictToAgentIpAddress
104104
If set, access to the VM used by packer to generate the image is restricted to the public IP address this script is run from.
105105
This parameter cannot be used in combination with the virtual_network_name packer parameter.
106-
.PARAMETER Force
107-
Delete the resource group if it exists without user confirmation.
108-
This parameter is deprecated and will be removed in a future release.
109-
.PARAMETER ReuseResourceGroup
110-
Reuse the resource group if it exists without user confirmation.
111-
This parameter is deprecated and will be removed in a future release.
112106
.PARAMETER OnError
113107
Specify how packer handles an error during image creation.
114108
Options:
@@ -150,24 +144,12 @@ Function GenerateResourcesAndImage {
150144
[Parameter(Mandatory = $False)]
151145
[switch] $RestrictToAgentIpAddress,
152146
[Parameter(Mandatory = $False)]
153-
[switch] $Force,
154-
[Parameter(Mandatory = $False)]
155-
[switch] $ReuseResourceGroup,
156-
[Parameter(Mandatory = $False)]
157147
[ValidateSet("abort", "ask", "cleanup", "run-cleanup-provisioner")]
158148
[string] $OnError = "ask",
159149
[Parameter(Mandatory = $False)]
160150
[hashtable] $Tags = @{}
161151
)
162152

163-
if ($Force -or $ReuseResourceGroup) {
164-
Write-Warning "The `ReuseResourceGroup` and `Force` parameters are deprecated and will be removed in a future release. The resource group will be reused when it already exists and an error will be thrown when it doesn't. If you want to delete the resource group, please delete it manually."
165-
}
166-
167-
if ($Force -and $ReuseResourceGroup) {
168-
throw "Force and ReuseResourceGroup cannot be used together."
169-
}
170-
171153
Show-LatestCommit -ErrorAction SilentlyContinue
172154

173155
# Validate packer is installed
@@ -266,73 +248,8 @@ Function GenerateResourcesAndImage {
266248
if ($ResourceGroupExists) {
267249
Write-Verbose "Resource group '$ResourceGroupName' already exists."
268250
}
269-
270-
# Remove resource group if it exists and we are not reusing it
271-
if ($ResourceGroupExists -and -not $ReuseResourceGroup) {
272-
if ($Force) {
273-
# Delete and recreate the resource group
274-
Write-Host "Deleting resource group '$ResourceGroupName'..."
275-
az group delete --name $ResourceGroupName --yes --output none
276-
if ($LastExitCode -ne 0) {
277-
throw "Failed to delete resource group '$ResourceGroupName'."
278-
}
279-
Write-Host "Resource group '$ResourceGroupName' was deleted."
280-
$ResourceGroupExists = $false
281-
}
282-
else {
283-
# are we running in a non-interactive session?
284-
# https://stackoverflow.com/questions/9738535/powershell-test-for-noninteractive-mode
285-
if ([System.Console]::IsOutputRedirected -or ![Environment]::UserInteractive -or !!([Environment]::GetCommandLineArgs() | Where-Object { $_ -ilike '-noni*' })) {
286-
throw "Non-interactive mode, resource group '$ResourceGroupName' already exists, either specify -Force to delete it, or -ReuseResourceGroup to reuse."
287-
}
288-
else {
289-
# Resource group already exists, ask the user what to do
290-
$title = "Resource group '$ResourceGroupName' already exists"
291-
$message = "Do you want to delete the resource group and all resources in it?"
292-
293-
$options = @(
294-
[System.Management.Automation.Host.ChoiceDescription]::new("&Yes", "Delete the resource group and all resources in it."),
295-
[System.Management.Automation.Host.ChoiceDescription]::new("&No", "Keep the resource group and continue."),
296-
[System.Management.Automation.Host.ChoiceDescription]::new("&Abort", "Abort execution.")
297-
)
298-
$result = $Host.UI.PromptForChoice($title, $message, $options, 0)
299-
}
300-
301-
switch ($result) {
302-
0 {
303-
# Delete and recreate the resource group
304-
Write-Host "Deleting resource group '$ResourceGroupName'..."
305-
az group delete --name $ResourceGroupName --yes
306-
if ($LastExitCode -ne 0) {
307-
throw "Failed to delete resource group '$ResourceGroupName'."
308-
}
309-
Write-Host "Resource group '$ResourceGroupName' was deleted."
310-
$ResourceGroupExists = $false
311-
}
312-
1 {
313-
# Keep the resource group and continue
314-
}
315-
2 {
316-
# Stop the current action
317-
Write-Error "User stopped the action."
318-
exit 1
319-
}
320-
}
321-
}
322-
}
323-
324-
# Create resource group
325-
if (-not $ResourceGroupExists) {
326-
Write-Host "Creating resource group '$ResourceGroupName' in location '$AzureLocation'..."
327-
if ($TagsList) {
328-
az group create --name $ResourceGroupName --location $AzureLocation --tags $TagsList --query id
329-
}
330-
else {
331-
az group create --name $ResourceGroupName --location $AzureLocation --query id
332-
}
333-
if ($LastExitCode -ne 0) {
334-
throw "Failed to create resource group '$ResourceGroupName'."
335-
}
251+
else {
252+
throw "Resource group '$ResourceGroupName' does not exist."
336253
}
337254

338255
# Create service principal

helpers/software-report-base/SoftwareReport.Nodes.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,4 +436,4 @@ class NoteNode: BaseNode {
436436
[Boolean] IsIdenticalTo([BaseNode] $OtherNode) {
437437
return $this.IsSimilarTo($OtherNode)
438438
}
439-
}
439+
}

images.CI/download-repo.ps1

Lines changed: 0 additions & 14 deletions
This file was deleted.

images.CI/linux-and-win/azure-pipelines/image-generation.yml

Lines changed: 0 additions & 181 deletions
This file was deleted.

images.CI/linux-and-win/azure-pipelines/ubuntu2004.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)