478: tasks.py: add update-terraform, terraform/flake.lock: Update r=Mic92 a=zowoq



Co-authored-by: zowoq <59103226+zowoq@users.noreply.github.com>
This commit is contained in:
bors[bot] 2023-03-15 08:33:11 +00:00 committed by GitHub
commit 66475fc83c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 3 deletions

View file

@ -198,6 +198,25 @@ def scan_age_keys(c, host):
)
@task
def update_terraform(c):
"""
Update terraform devshell flake
"""
with c.cd("terraform"):
c.run(
"""
system="$(nix eval --impure --raw --expr 'builtins.currentSystem')"
old="$(nix build --no-link --print-out-paths ".#devShells.${system}.default")"
nix flake update --commit-lock-file
new="$(nix build --no-link --print-out-paths ".#devShells.${system}.default")"
commit="$(git log --pretty=format:%B -1)"
diff="$(nix store diff-closures "${old}" "${new}" | awk -F ',' '/terraform/ && /→/ {print $1}')"
git commit --amend -m "${commit}" -m "Terraform updates:" -m "${diff}"
"""
)
@task
def format_disks(c, hosts="", disks=""):
"""

6
terraform/flake.lock generated
View file

@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1676795730,
"narHash": "sha256-X69A9BdcPTySJJ7DqS4wc8b6eqGKi32jCSyaBsz4WB0=",
"lastModified": 1678780369,
"narHash": "sha256-D8wM0K1EkWLwbUu9fohC57+n89zC9qQ3hdC9Bys5GYw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "efc59894b1ba73cb745676616c56c780383d6788",
"rev": "1474943fd91fbe5567f7582acf568e0f999f4af1",
"type": "github"
},
"original": {