2018-08-15 00:32:58 +03:00
|
|
|
build-packer:
|
2020-01-17 01:56:25 +03:00
|
|
|
@packer build -var-file=vhd/packer/settings.json vhd/packer/vhd-image-builder.json
|
2018-08-15 00:32:58 +03:00
|
|
|
|
2019-08-19 23:07:40 +03:00
|
|
|
build-packer-windows:
|
2020-10-09 02:16:32 +03:00
|
|
|
@packer build -var-file=vhd/packer/settings.json -var-file=vhd/packer/windows-${WINDOWS_SERVER_VERSION}-vars.json vhd/packer/windows-vhd-builder.json
|
2019-08-19 23:07:40 +03:00
|
|
|
|
2018-08-15 00:32:58 +03:00
|
|
|
init-packer:
|
2020-01-17 01:56:25 +03:00
|
|
|
@./vhd/packer/init-variables.sh
|
2018-08-15 00:32:58 +03:00
|
|
|
|
|
|
|
az-login:
|
|
|
|
az login --service-principal -u ${CLIENT_ID} -p ${CLIENT_SECRET} --tenant ${TENANT_ID}
|
|
|
|
|
|
|
|
run-packer: az-login
|
2019-03-05 20:31:16 +03:00
|
|
|
@packer version && set -o pipefail && ($(MAKE) init-packer | tee packer-output) && ($(MAKE) build-packer | tee -a packer-output)
|
2018-08-15 00:32:58 +03:00
|
|
|
|
2019-08-19 23:07:40 +03:00
|
|
|
run-packer-windows: az-login
|
|
|
|
@packer version && set -o pipefail && ($(MAKE) init-packer | tee packer-output) && ($(MAKE) build-packer-windows | tee -a packer-output)
|
|
|
|
|
2018-08-15 00:32:58 +03:00
|
|
|
az-copy: az-login
|
2022-09-22 23:26:25 +03:00
|
|
|
azcopy-preview copy "${OS_DISK_SAS}" "${SA_CONTAINER_URL}?${SA_TOKEN}"
|
2018-08-15 00:32:58 +03:00
|
|
|
|
2019-02-27 20:39:59 +03:00
|
|
|
delete-sa: az-login
|
2022-09-14 23:18:59 +03:00
|
|
|
az storage account delete -n ${PACKER_TEMP_SA} -g ${PACKER_TEMP_GROUP} --yes
|
2019-02-27 20:39:59 +03:00
|
|
|
|
2018-08-15 00:32:58 +03:00
|
|
|
generate-sas: az-login
|
2022-09-12 08:13:07 +03:00
|
|
|
az storage container generate-sas --name ubuntu --permissions lr --connection-string "${CLASSIC_SA_CONNECTION_STRING}" --start ${START_DATE} --expiry ${EXPIRY_DATE} | tr -d '"' | tee -a vhd-sas && cat vhd-sas
|
2020-01-09 22:08:47 +03:00
|
|
|
|
|
|
|
windows-vhd-publishing-info: az-login
|
2020-01-17 01:56:25 +03:00
|
|
|
@./vhd/packer/generate-windows-vhd-publishing-info.sh
|
2022-09-14 23:18:59 +03:00
|
|
|
|
|
|
|
sig-image-version: az-login
|
|
|
|
az sig image-version create \
|
|
|
|
--resource-group ${SIG_GROUP} \
|
|
|
|
--gallery-name ${SIG_NAME} \
|
|
|
|
--gallery-image-definition ${SIG_IMG_DEF} \
|
|
|
|
--gallery-image-version ${VHD_VERSION} \
|
|
|
|
--target-regions ${SIG_LOCATION} \
|
|
|
|
--replica-count 1 \
|
|
|
|
--os-vhd-uri ${SA_CONTAINER_URL}/${VHD_NAME} \
|
|
|
|
--os-vhd-storage-account ${VHD_SA}
|