mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
Add script to create and upload GCE image.
This commit is contained in:
parent
36c05d5e5b
commit
3f15f8b703
1 changed files with 14 additions and 0 deletions
14
nixos/maintainers/scripts/gce/create-gce.sh
Executable file
14
nixos/maintainers/scripts/gce/create-gce.sh
Executable file
|
@ -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)
|
Loading…
Add table
Add a link
Reference in a new issue