Add current commit into logs for custom builds (#1419)

* Show latest commit for custom repos

* Remove unused variables from templates

* Add Get-LatestCommit function

* Fix in synopsis

* Remove SSH_Password variables from Windows Images

* Rename download-customrepo

* Fix in synopsis
This commit is contained in:
Maksim Petrov
2020-08-24 12:31:51 +03:00
committed by GitHub
parent ba17c75613
commit f97706e248
9 changed files with 39 additions and 40 deletions

View File

@@ -9,7 +9,6 @@
"storage_account": "{{env `ARM_STORAGE_ACCOUNT`}}",
"temp_resource_group_name": "{{env `TEMP_RESOURCE_GROUP_NAME`}}",
"location": "{{env `ARM_RESOURCE_LOCATION`}}",
"ssh_password": "{{env `SSH_PASSWORD`}}",
"virtual_network_name": "{{env `VNET_NAME`}}",
"virtual_network_resource_group_name": "{{env `VNET_RESOURCE_GROUP`}}",
"virtual_network_subnet_name": "{{env `VNET_SUBNET`}}",
@@ -20,12 +19,9 @@
"root_folder": "C:",
"toolset_json_path": "{{env `TEMP`}}\\toolset.json",
"image_folder": "C:\\image",
"commit_file": "C:\\image\\commit.txt",
"imagedata_file": "C:\\imagedata.json",
"metadata_file": "C:\\image\\metadata.txt",
"helper_script_folder": "C:\\Program Files\\WindowsPowerShell\\Modules\\",
"psmodules_root_folder": "C:\\Modules",
"commit_id": "LATEST",
"install_user": "installer",
"install_password": null,
"capture_name_prefix": "packer",
@@ -34,7 +30,7 @@
"github_feed_token": "{{env `GITHUB_FEED_TOKEN`}}",
"announcements": "{{env `ANNOUNCEMENTS`}}"
},
"sensitive-variables": ["install_password", "ssh_password", "client_secret", "github_feed_token"],
"sensitive-variables": ["install_password", "client_secret", "github_feed_token"],
"builders": [
{
"name": "vhd",
@@ -70,9 +66,7 @@
{
"type": "powershell",
"inline":[
"New-Item -Path {{user `image_folder`}} -ItemType Directory -Force",
"Write-Output {{user `commit_id`}} > {{user `commit_file`}}",
"Write-Host (Get-Content -Path {{user `commit_file`}})"
"New-Item -Path {{user `image_folder`}} -ItemType Directory -Force"
]
},
{