@leverege/build-tools 2.43.7 → 2.43.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/encrypt-secrets.sh +9 -7
package/package.json
CHANGED
package/src/encrypt-secrets.sh
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
display_usage() {
|
|
3
3
|
echo "This script encrypts files using Google KMS."
|
|
4
|
-
echo -e "\nInputs: .env and secrets directory (if
|
|
4
|
+
echo -e "\nInputs: .env and secrets directory (if they exist) \n"
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
if [ "$1" == "-h" ]; then
|
|
@@ -34,12 +34,14 @@ else
|
|
|
34
34
|
fi
|
|
35
35
|
|
|
36
36
|
# encrypt .env file
|
|
37
|
-
|
|
38
|
-
--
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
if [ -f ".env" ]; then
|
|
38
|
+
gcloud kms encrypt --project $gcp_project \
|
|
39
|
+
--key circle-ci \
|
|
40
|
+
--keyring build-tools \
|
|
41
|
+
--location us-east4 \
|
|
42
|
+
--plaintext-file .env \
|
|
43
|
+
--ciphertext-file .env.enc
|
|
44
|
+
fi
|
|
43
45
|
|
|
44
46
|
if [ -d "secrets" ]; then
|
|
45
47
|
# tar up secrets directory
|