3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #3838 from oconnorr/master

Update create-gce.sh
This commit is contained in:
Rob Vermaas 2014-08-29 10:08:55 +02:00
commit b7a0101578

View file

@ -1,5 +1,6 @@
#! /bin/sh -e #! /bin/sh -e
BUCKET_NAME=${BUCKET_NAME:-nixos}
export NIX_PATH=nixpkgs=../../../.. export NIX_PATH=nixpkgs=../../../..
export NIXOS_CONFIG=$(dirname $(readlink -f $0))/../../../modules/virtualisation/google-compute-image.nix export NIXOS_CONFIG=$(dirname $(readlink -f $0))/../../../modules/virtualisation/google-compute-image.nix
export TIMESTAMP=$(date +%Y%m%d%H%M) export TIMESTAMP=$(date +%Y%m%d%H%M)
@ -8,7 +9,7 @@ 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 -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) img=$(echo gce/*.tar.gz)
if ! gsutil ls gs://nixos/$(basename $img); then if ! gsutil ls gs://${BUCKET_NAME}/$(basename $img); then
gsutil cp $img gs://nixos/$(basename $img) gsutil cp $img gs://${BUCKET_NAME}/$(basename $img)
fi fi
gcutil addimage $(basename $img .raw.tar.gz | sed 's|\.|-|' | sed 's|_|-|') gs://nixos/$(basename $img) gcloud compute images create $(basename $img .raw.tar.gz | sed 's|\.|-|' | sed 's|_|-|') --source-uri gs://${BUCKET_NAME}/$(basename $img)