@leverege/build-tools 2.18.0-beta.3 → 2.18.0-beta.5
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.
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.18.0-beta.
|
|
3
|
+
"version": "2.18.0-beta.5",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"bin": {
|
|
23
23
|
"build-tools": "src/build-tools.js",
|
|
24
24
|
"circleate": "src/circleate",
|
|
25
|
-
"decrypt-env-to-pipeline": "src/decrypt-env-to-pipeline",
|
|
26
25
|
"decrypt-secrets": "src/decrypt-secrets",
|
|
27
26
|
"dirty-git": "src/dirty-git",
|
|
28
27
|
"dockreate": "src/dockreate",
|
package/src/decrypt-secrets
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
+
echo "_______STARTING_DECRYPT_SECRETS__________" # XXX
|
|
2
3
|
display_usage() {
|
|
3
4
|
echo "This script decrypts files using Google KMS."
|
|
4
5
|
echo -e "\nInputs: .env.enc and secrets.tar.gz.enc (if it exists) \n"
|
|
@@ -58,16 +59,19 @@ initialize_gcloud() {
|
|
|
58
59
|
|
|
59
60
|
function decryptEnvToPipeline() {
|
|
60
61
|
echo "------------- BitBucket Pipeline Detected -------------"
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
echo " GCLOUD_PROJECT [$GCLOUD_PROJECT]"
|
|
63
|
+
echo " GCLOUD_COMPUTE_ZONE [$GCLOUD_COMPUTE_ZONE]"
|
|
64
|
+
|
|
65
|
+
gcloud --quiet config set project ${GCLOUD_PROJECT}
|
|
66
|
+
gcloud --quiet config set compute/zone ${GCLOUD_COMPUTE_ZONE}
|
|
63
67
|
echo ${GCLOUD_SERVICE_KEY} | gcloud auth activate-service-account --key-file=-
|
|
64
68
|
|
|
65
69
|
# decrypt .env.enc file
|
|
66
70
|
gcloud kms decrypt \
|
|
67
|
-
--project $
|
|
71
|
+
--project $GCLOUD_PROJECT \
|
|
68
72
|
--key circle-ci \
|
|
69
73
|
--keyring build-tools \
|
|
70
|
-
--location $
|
|
74
|
+
--location $GCLOUD_COMPUTE_ZONE \
|
|
71
75
|
--plaintext-file .env \
|
|
72
76
|
--ciphertext-file .env.enc
|
|
73
77
|
|
|
@@ -79,6 +83,8 @@ if [ "$1" == "-h" ]; then
|
|
|
79
83
|
exit 1
|
|
80
84
|
fi
|
|
81
85
|
|
|
86
|
+
echo "BITBUCKETCI=[$BITBUCKETCI] CIRCLECI=[$CIRCLECI]"
|
|
87
|
+
|
|
82
88
|
if [ "$BITBUCKETCI" == "true" ];
|
|
83
89
|
then
|
|
84
90
|
decryptEnvToPipeline
|
|
@@ -89,6 +95,8 @@ if [ "$CIRCLECI" == "true" ]; then
|
|
|
89
95
|
initialize_gcloud
|
|
90
96
|
fi
|
|
91
97
|
|
|
98
|
+
echo "XXXXXXXXXX SHOULD NOT BE HERE XXXXXXXXXX" && exit 0 # XXX
|
|
99
|
+
|
|
92
100
|
git_origin=`git config --get remote.origin.url`
|
|
93
101
|
|
|
94
102
|
if [[ $git_origin = https* ]]; then
|