blob: c7a976938004ae0a8af7e1aeda69e3d11901bf48 [file] [log] [blame]
Sergiusz Bazanskia4b37672019-05-15 19:23:38 +02001#!/usr/bin/env bash
2
3# A wrapper around real nixops to decrypt GCP secret.
4
5if [ -z "$hscloud_root" ]; then
6 echo 2>&1 "Please source env.sh"
7 exit 1
8fi
9
10for f in sa.json; do
11 plain="$hscloud_root/gcp/secrets/plain/sa.json"
12 cipher="$hscloud_root/gcp/secrets/cipher/sa.json"
13 if [ ! -f "$plain" ]; then
14 secretstore decrypt "$cipher" > "$plain"
15 fi
16done
17
18nixops.bin "$@"