@leverege/build-tools 2.18.0-beta.11 → 2.18.0-beta.2
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.2",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -22,6 +22,7 @@
|
|
|
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",
|
|
25
26
|
"decrypt-secrets": "src/decrypt-secrets",
|
|
26
27
|
"dirty-git": "src/dirty-git",
|
|
27
28
|
"dockreate": "src/dockreate",
|
package/src/decrypt-secrets
CHANGED
|
@@ -5,7 +5,6 @@ display_usage() {
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
install_gcloud() {
|
|
8
|
-
uname -a
|
|
9
8
|
install () {
|
|
10
9
|
# Set sudo to work whether logged in as root user or non-root user
|
|
11
10
|
if [[ $EUID == 0 ]]; then export SUDO=""; else export SUDO="sudo"; fi
|
|
@@ -58,22 +57,16 @@ initialize_gcloud() {
|
|
|
58
57
|
}
|
|
59
58
|
|
|
60
59
|
function decryptEnvToPipeline() {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
printf " GCLOUD_COMPUTE_ZONE [$GCLOUD_COMPUTE_ZONE]\n"
|
|
64
|
-
|
|
65
|
-
#install_gcloud
|
|
66
|
-
|
|
67
|
-
gcloud --quiet config set project ${GCLOUD_PROJECT}
|
|
68
|
-
gcloud --quiet config set compute/zone ${GCLOUD_COMPUTE_ZONE}
|
|
60
|
+
gcloud --quiet config set project ${GOOGLE_PROJECT}
|
|
61
|
+
gcloud --quiet config set compute/zone ${GOOGLE_COMPUTE_ZONE}
|
|
69
62
|
echo ${GCLOUD_SERVICE_KEY} | gcloud auth activate-service-account --key-file=-
|
|
70
63
|
|
|
71
64
|
# decrypt .env.enc file
|
|
72
65
|
gcloud kms decrypt \
|
|
73
|
-
--project $
|
|
66
|
+
--project $GOOGLE_PROJECT \
|
|
74
67
|
--key circle-ci \
|
|
75
68
|
--keyring build-tools \
|
|
76
|
-
--location $
|
|
69
|
+
--location $GOOGLE_COMPUTE_ZONE \
|
|
77
70
|
--plaintext-file .env \
|
|
78
71
|
--ciphertext-file .env.enc
|
|
79
72
|
|
|
@@ -85,8 +78,6 @@ if [ "$1" == "-h" ]; then
|
|
|
85
78
|
exit 1
|
|
86
79
|
fi
|
|
87
80
|
|
|
88
|
-
printf "\nBITBUCKETCI=[$BITBUCKETCI] CIRCLECI=[$CIRCLECI]\n"
|
|
89
|
-
|
|
90
81
|
if [ "$BITBUCKETCI" == "true" ];
|
|
91
82
|
then
|
|
92
83
|
decryptEnvToPipeline
|
|
@@ -106,7 +97,7 @@ else
|
|
|
106
97
|
fi
|
|
107
98
|
|
|
108
99
|
# Set project based on org name
|
|
109
|
-
printf "\
|
|
100
|
+
printf "\nDetecting organization name...\n"
|
|
110
101
|
|
|
111
102
|
if [ "$git_orgname" = "leverege" ]; then
|
|
112
103
|
printf "\nUsing leverege\n\n"
|