Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gce/create-gce.sh: rewrite using nix-shell shebang and bash #24869

Merged
merged 4 commits into from Apr 13, 2017

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented Apr 13, 2017

Motivation for this change
  • allows to run the script without being the same directory
  • nix-shell install google-cloud-sdk
  • some shellcheck cleanups and scripting best practice
Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Mic92 and others added 2 commits April 13, 2017 07:10
- allows to run the script without being the same directory
- nix-shell install google-cloud-sdk
- some shellcheck cleanups and scripting best practice
@mention-bot
Copy link

@Mic92, thanks for your PR! By analyzing the history of the files in this pull request, we identified @rbvermaa, @aristidb and @oconnorr to be potential reviewers.

set -euo pipefail

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
NIXPKGS_ROOT="$DIR/../../../../"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to simply use nixpkgs from $NIX_PATH, similar to nixos/maintainers/scripts/ec2/create-amis.sh. I often need to tweak create-amis.sh temporarily (e.g. upload to one region first) but I do want to ensure that the Nixpkgs used to build the image corresponds cleanly to a channel, rather than my working directory. So I do NIX_PATH=nixpkgs=channel:nixos-17.03 ./nixos/maintainers/scripts/ec2/create-amis.sh.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

-A config.system.build.googleComputeImage \
--argstr system x86_64-linux \
-o gce \
--option extra-binary-caches https://hydra.nixos.org \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I swapped http with https here, to make building an image remote a bit more trustworthy.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this option legacy, AFAIK hydra.nixos.org doesn't serve anything anymore.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

this allows NIX_PATH to be overwritten to build a different release
@Mic92 Mic92 merged commit 73c8797 into NixOS:master Apr 13, 2017
@Mic92 Mic92 deleted the gce branch April 13, 2017 11:42
benley pushed a commit to benley/nixpkgs that referenced this pull request May 23, 2017
)

* google-cloud-sdk: 150.0.0 -> 151.0.0

- gce/create-gce.sh: rewrite using nix-shell shebang and bash
- allows to run the script without being the same directory
- nix-shell install google-cloud-sdk
- some shellcheck cleanups and scripting best practice
- gce/create-gce.sh: do not clobber NIX_PATH: this allows NIX_PATH to be overwritten to build a different release
- gce/create-gce.sh: remove legacy hydra option

(cherry picked from commit 73c8797)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants