Skip to content

Commit

Permalink
Remove GithubFeedToken build parameter (actions#3184)
Browse files Browse the repository at this point in the history
  • Loading branch information
Darleev authored Apr 15, 2021
1 parent 94fc8cc commit 575108f
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 18 deletions.
2 changes: 0 additions & 2 deletions docs/create-image-and-azure-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ The Packer template includes `variables` section containing user variables used
- `virtual_network_resource_group_name` - If `virtual_network_name` is set, this value may also be set. If `virtual_network_name` is set, and this value is not set the builder attempts to determine the resource group containing the virtual network. If the resource group cannot be found, or it cannot be disambiguated, this value should be set.
- `virtual_network_subnet_name` - If `virtual_network_name` is set, this value may also be set. If `virtual_network_name` is set, and this value is not set the builder attempts to determine the subnet to use with the virtual network. If the subnet cannot be found, or it cannot be disambiguated, this value should be set.
- `capture_name_prefix` - VHD prefix. The final artifacts will be named PREFIX-osDisk.UUID and PREFIX-vmTemplate.UUID.
- `github_feed_token` - Github PAT. Required for NPM toolcache installation. Will be depricated soon.

### Builder variables
The `builders` section contains variables for the `azure-arm` builder used in the project. Most of the builder variables are inherited from the `user variables` section, however, the variables can be overwritten to adjust image-generation performance.
Expand All @@ -123,7 +122,6 @@ Generated tool versions and details can be found in related projects:
- [Python](https://github.com/actions/python-versions/)
- [Go](https://github.com/actions/go-versions)
- [Node](https://github.com/actions/node-versions)
- [Boost](https://github.com/actions/boost-versions)

### Post-generation scripts
The user, created during the image generation, does not exist in the result VHD hence some configuration files related to the user's home directory need to be changed as well as the file permissions for some directories. Scripts for that are located in the `post-generation` folder in the repository:
Expand Down
12 changes: 0 additions & 12 deletions helpers/GenerateResourcesAndImage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ Function GenerateResourcesAndImage {
.PARAMETER Force
Delete the resource group if it exists without user confirmation.
.PARAMETER GithubFeedToken
GitHub PAT to download tool packages from GitHub Package Registry
.PARAMETER AzureClientId
Client id needs to be provided for optional authentication via service principal. Example: "11111111-1111-1111-1111-111111111111"
Expand All @@ -109,8 +106,6 @@ Function GenerateResourcesAndImage {
[Parameter(Mandatory = $False)]
[int] $SecondsToWaitForServicePrincipalSetup = 30,
[Parameter(Mandatory = $False)]
[string] $GithubFeedToken,
[Parameter(Mandatory = $False)]
[string] $AzureClientId,
[Parameter(Mandatory = $False)]
[string] $AzureClientSecret,
Expand All @@ -120,12 +115,6 @@ Function GenerateResourcesAndImage {
[Switch] $Force
)

if ([string]::IsNullOrEmpty($GithubFeedToken))
{
Write-Error "'-GithubFeedToken' parameter is not specified. You have to specify valid GitHub PAT to download tool packages from GitHub Package Registry"
exit 1
}

$builderScriptPath = Get-PackerTemplatePath -RepositoryRoot $ImageGenerationRepositoryRoot -ImageType $ImageType
$ServicePrincipalClientSecret = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper();
$InstallPassword = $env:UserName + [System.GUID]::NewGuid().ToString().ToUpper();
Expand Down Expand Up @@ -235,6 +224,5 @@ Function GenerateResourcesAndImage {
-var "resource_group=$($ResourceGroupName)" `
-var "storage_account=$($storageAccountName)" `
-var "install_password=$($InstallPassword)" `
-var "github_feed_token=$($GithubFeedToken)" `
$builderScriptPath
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
-VirtualNetworkName $(BUILD_AGENT_VNET_NAME) `
-VirtualNetworkRG $(BUILD_AGENT_VNET_RESOURCE_GROUP) `
-VirtualNetworkSubnet $(BUILD_AGENT_SUBNET_NAME) `
-GitHubFeedToken $(GITHUB_TOKEN)

env:
PACKER_LOG: 1
PACKER_LOG_PATH: $(Build.ArtifactStagingDirectory)/packer-log.txt
Expand Down
2 changes: 0 additions & 2 deletions images.CI/linux-and-win/build-image.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ param(
[String] [Parameter (Mandatory=$true)] $TemplatePath,
[String] [Parameter (Mandatory=$true)] $ClientId,
[String] [Parameter (Mandatory=$true)] $ClientSecret,
[String] [Parameter (Mandatory=$true)] $GitHubFeedToken,
[String] [Parameter (Mandatory=$true)] $ResourcesNamePrefix,
[String] [Parameter (Mandatory=$true)] $Location,
[String] [Parameter (Mandatory=$true)] $ResourceGroup,
Expand Down Expand Up @@ -44,7 +43,6 @@ packer build -var "capture_name_prefix=$ResourcesNamePrefix" `
-var "client_id=$ClientId" `
-var "client_secret=$ClientSecret" `
-var "install_password=$InstallPassword" `
-var "github_feed_token=$GitHubFeedToken" `
-var "location=$Location" `
-var "resource_group=$ResourceGroup" `
-var "storage_account=$StorageAccount" `
Expand Down
1 change: 0 additions & 1 deletion images.CI/macos/azure-pipelines/image-generation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ jobs:
-var="vm_password=$(vm-password)" `
-var="build_id=$(VirtualMachineName)" `
-var="baseimage_name=${{ parameters.base_image_name }}" `
-var="github_feed_token=$(github-feed-token)" `
-var="xcode_install_user=$(xcode-installation-user)" `
-var="xcode_install_password=$(xcode-installation-password)" `
-color=false `
Expand Down

0 comments on commit 575108f

Please sign in to comment.