diff options
author | Rob Vermaas <rob.vermaas@gmail.com> | 2014-04-14 14:38:44 +0200 |
---|---|---|
committer | Rob Vermaas <rob.vermaas@gmail.com> | 2014-04-14 14:38:52 +0200 |
commit | 3f15f8b703f8737117f7364bb2c4de3f48de4ff0 (patch) | |
tree | 8a5928711e51d4b54c9042d86cbb05d892e7bd52 /nixos/maintainers | |
parent | 36c05d5e5b0025c9c6f62b101478e5e9f6da8d91 (diff) |
Add script to create and upload GCE image.
Diffstat (limited to 'nixos/maintainers')
-rwxr-xr-x | nixos/maintainers/scripts/gce/create-gce.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/nixos/maintainers/scripts/gce/create-gce.sh b/nixos/maintainers/scripts/gce/create-gce.sh new file mode 100755 index 000000000000..8bf36f33c7db --- /dev/null +++ b/nixos/maintainers/scripts/gce/create-gce.sh @@ -0,0 +1,14 @@ +#! /bin/sh -e + +export NIX_PATH=nixpkgs=../../../.. +export NIXOS_CONFIG=$(dirname $(readlink -f $0))/../../../modules/virtualisation/google-compute-image.nix +export TIMESTAMP=$(date +%Y%m%d%H%M) + +nix-build '<nixpkgs/nixos>' \ + -A config.system.build.googleComputeImage --argstr system x86_64-linux -o gce --option extra-binary-caches http://hydra.nixos.org -j 10 + +img=$(echo gce/*.tar.gz) +if ! gsutil ls gs://nixos/$(basename $img); then + gsutil cp $img gs://nixos/$(basename $img) +fi +gcutil addimage $(basename $img .raw.tar.gz | sed 's|\.|-|' | sed 's|_|-|') gs://nixos/$(basename $img) |