Merge pull request #71970 from johanot/create-gce-nitpick

scripts/gce: make image name configurable
This commit is contained in:
Jörg Thalheim 2019-10-25 14:28:06 +01:00 committed by GitHub
commit 8e0563e7e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,7 +15,7 @@ nix-build '<nixpkgs/nixos/lib/eval-config.nix>' \
-j 10 -j 10
img_path=$(echo gce/*.tar.gz) img_path=$(echo gce/*.tar.gz)
img_name=$(basename "$img_path") img_name=${IMAGE_NAME:-$(basename "$img_path")}
img_id=$(echo "$img_name" | sed 's|.raw.tar.gz$||;s|\.|-|g;s|_|-|g') img_id=$(echo "$img_name" | sed 's|.raw.tar.gz$||;s|\.|-|g;s|_|-|g')
if ! gsutil ls "gs://${BUCKET_NAME}/$img_name"; then if ! gsutil ls "gs://${BUCKET_NAME}/$img_name"; then
gsutil cp "$img_path" "gs://${BUCKET_NAME}/$img_name" gsutil cp "$img_path" "gs://${BUCKET_NAME}/$img_name"