nixos/azure: upload-image names the image better
This commit is contained in:
parent
c2b2cc6dbd
commit
a5de97f21e
|
@ -8,13 +8,16 @@ nix-build ./examples/basic/image.nix --out-link "azure"
|
||||||
|
|
||||||
group="nixos-images"
|
group="nixos-images"
|
||||||
location="westus2"
|
location="westus2"
|
||||||
img_name="azure-image-todo-makethisbetter" # TODO: clean this up
|
img_name="nixos-image"
|
||||||
img_file="$(readlink -f ./azure/disk.vhd)" # TODO: this doesn't feel great either
|
img_file="$(readlink -f ./azure/disk.vhd)"
|
||||||
|
|
||||||
if ! az group show -n "${group}" &>/dev/null; then
|
if ! az group show -n "${group}" &>/dev/null; then
|
||||||
az group create --name "${group}" --location "${location}"
|
az group create --name "${group}" --location "${location}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# note: the disk access token song/dance is tedious
|
||||||
|
# but allows us to upload direct to a disk image
|
||||||
|
# thereby avoid storage accounts (and naming them) entirely!
|
||||||
if ! az disk show -g "${group}" -n "${img_name}" &>/dev/null; then
|
if ! az disk show -g "${group}" -n "${img_name}" &>/dev/null; then
|
||||||
bytes="$(stat -c %s ${img_file})"
|
bytes="$(stat -c %s ${img_file})"
|
||||||
size="30"
|
size="30"
|
||||||
|
|
Loading…
Reference in New Issue