Skip to content

Commit

Permalink
scripts: add upload-release-image
Browse files Browse the repository at this point in the history
  • Loading branch information
Freax13 committed Nov 4, 2024
1 parent ee9ba1a commit be9707f
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions packages/scripts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,55 @@
'';
};

upload-release-image = writeShellApplication {
name = "upload-release-image";
runtimeInputs = with pkgs; [
azure-cli
uplosi
];
text =
let
image = pkgs.image-podvm;
in
''
imageVersion=""
for i in "$@"; do
case $i in
--version=*)
imageVersion="''${i#*=}"
shift
;;
*)
echo "Unknown option $i"
exit 1
;;
esac
done
set -x
# Create an uplosi config.
cat <<EOF > uplosi.conf
[base]
imageVersion = "''${imageVersion}"
name = "contrast"
provider = "azure"
[base.azure]
subscriptionID = "0d202bbb-4fa7-4af8-8125-58c269a05435"
location = "GermanyWestCentral"
resourceGroup = "contrast-images"
sharedImageGallery = "contrast_images"
sharingProfile = "community"
sharingNamePrefix = "Contrast"
replicationRegions = ["eu-west-1", "eu-west-3", "us-east-1", "us-east-2", "ap-south-1"]
EOF
uplosi upload ${image}/*.raw
'';
};

generate = writeShellApplication {
name = "generate";
runtimeInputs = with pkgs; [
Expand Down

0 comments on commit be9707f

Please sign in to comment.