@leverege/build-tools 1.13.7 → 2.0.1
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/lib/server/decrypt-secrets +28 -11
- package/lib/server/dockreate +1 -1
- package/lib/server/encrypt-secrets +28 -10
- package/package.json +1 -1
- package/src/decrypt-secrets +28 -11
- package/src/dockreate +1 -1
- package/src/encrypt-secrets +28 -10
|
@@ -66,11 +66,37 @@ if [ "$CIRCLECI" == "true" ]; then
|
|
|
66
66
|
initialize_gcloud
|
|
67
67
|
fi
|
|
68
68
|
|
|
69
|
+
# Attempt to grab org name from git remote origin
|
|
70
|
+
git_orgname=`git config --get remote.origin.url | cut -d ":" -f 2 | cut -d "/" -f 1`
|
|
71
|
+
|
|
72
|
+
# Set project based on org name
|
|
73
|
+
printf "\nDetecting organization name...\n"
|
|
74
|
+
|
|
75
|
+
if [ "$git_orgname" = "leverege" ]; then
|
|
76
|
+
printf "\nUsing leverege\n\n"
|
|
77
|
+
gcp_project=leverege-docker-images
|
|
78
|
+
elif [ "$git_orgname" = "cox2m" ]; then
|
|
79
|
+
printf "\nUsing cox2m\n\n"
|
|
80
|
+
gcp_project=cox2m-docker-images
|
|
81
|
+
else
|
|
82
|
+
printf "\nDid not recognize organization name...\n"
|
|
83
|
+
printf "\nDefaulting to leverege\n\n"
|
|
84
|
+
gcp_project=leverege-docker-images
|
|
85
|
+
fi
|
|
86
|
+
|
|
87
|
+
# decrypt .env.enc file
|
|
88
|
+
gcloud kms decrypt \
|
|
89
|
+
--project $gcp_project \
|
|
90
|
+
--key circle-ci \
|
|
91
|
+
--keyring build-tools \
|
|
92
|
+
--location us-east4 \
|
|
93
|
+
--plaintext-file .env \
|
|
94
|
+
--ciphertext-file .env.enc
|
|
69
95
|
|
|
70
96
|
if [ -f "secrets.tar.gz.enc" ]; then
|
|
71
97
|
# decrypt the secrets.tar.gz.enc
|
|
72
98
|
gcloud kms decrypt \
|
|
73
|
-
--project
|
|
99
|
+
--project $gcp_project \
|
|
74
100
|
--key circle-ci \
|
|
75
101
|
--keyring build-tools \
|
|
76
102
|
--location us-east4 \
|
|
@@ -79,13 +105,4 @@ if [ -f "secrets.tar.gz.enc" ]; then
|
|
|
79
105
|
|
|
80
106
|
# untar secrets.tar.gz
|
|
81
107
|
tar xvzf secrets.tar.gz
|
|
82
|
-
fi
|
|
83
|
-
|
|
84
|
-
# decrypt .env.enc file
|
|
85
|
-
gcloud kms decrypt \
|
|
86
|
-
--project leverege-docker-images \
|
|
87
|
-
--key circle-ci \
|
|
88
|
-
--keyring build-tools \
|
|
89
|
-
--location us-east4 \
|
|
90
|
-
--plaintext-file .env \
|
|
91
|
-
--ciphertext-file .env.enc
|
|
108
|
+
fi
|
package/lib/server/dockreate
CHANGED
|
@@ -312,7 +312,7 @@ echo "Creating Docker Image for $gcimage:$version"
|
|
|
312
312
|
echo " Building the workspace"
|
|
313
313
|
|
|
314
314
|
# use kaniko to cache builds
|
|
315
|
-
gcloud config set builds/use_kaniko True
|
|
315
|
+
[ "$USE_KANIKO" == "yes" ] && gcloud config set builds/use_kaniko True
|
|
316
316
|
|
|
317
317
|
# submit the build request to gcloud
|
|
318
318
|
gcloud builds submit --tag $gcimage:$version .
|
|
@@ -9,23 +9,41 @@ if [ "$1" == "-h" ]; then
|
|
|
9
9
|
exit 1
|
|
10
10
|
fi
|
|
11
11
|
|
|
12
|
+
# Attempt to grab org name from git remote origin
|
|
13
|
+
git_orgname=`git config --get remote.origin.url | cut -d ":" -f 2 | cut -d "/" -f 1`
|
|
14
|
+
|
|
15
|
+
# Set project based on org name
|
|
16
|
+
printf "\nDetecting organization name...\n"
|
|
17
|
+
|
|
18
|
+
if [ "$git_orgname" = "leverege" ]; then
|
|
19
|
+
printf "\nUsing leverege\n\n"
|
|
20
|
+
gcp_project=leverege-docker-images
|
|
21
|
+
elif [ "$git_orgname" = "cox2m" ]; then
|
|
22
|
+
printf "\nUsing cox2m\n\n"
|
|
23
|
+
gcp_project=cox2m-docker-images
|
|
24
|
+
else
|
|
25
|
+
printf "\nDid not recognize organization name...\n"
|
|
26
|
+
printf "\nDefaulting to leverege\n\n"
|
|
27
|
+
gcp_project=leverege-docker-images
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
# encrypt .env file
|
|
31
|
+
gcloud kms encrypt --project $gcp_project \
|
|
32
|
+
--key circle-ci \
|
|
33
|
+
--keyring build-tools \
|
|
34
|
+
--location us-east4 \
|
|
35
|
+
--plaintext-file .env \
|
|
36
|
+
--ciphertext-file .env.enc
|
|
37
|
+
|
|
12
38
|
if [ -d "secrets" ]; then
|
|
13
39
|
# tar up secrets directory
|
|
14
40
|
tar -zcvf secrets.tar.gz secrets
|
|
15
41
|
# encrypt secrets file
|
|
16
42
|
gcloud kms encrypt \
|
|
17
|
-
--project
|
|
43
|
+
--project $gcp_project \
|
|
18
44
|
--key circle-ci \
|
|
19
45
|
--keyring build-tools \
|
|
20
46
|
--location us-east4 \
|
|
21
47
|
--plaintext-file secrets.tar.gz \
|
|
22
48
|
--ciphertext-file secrets.tar.gz.enc
|
|
23
|
-
fi
|
|
24
|
-
|
|
25
|
-
# encrypt .env file
|
|
26
|
-
gcloud kms encrypt --project leverege-docker-images \
|
|
27
|
-
--key circle-ci \
|
|
28
|
-
--keyring build-tools \
|
|
29
|
-
--location us-east4 \
|
|
30
|
-
--plaintext-file .env \
|
|
31
|
-
--ciphertext-file .env.enc
|
|
49
|
+
fi
|
package/package.json
CHANGED
package/src/decrypt-secrets
CHANGED
|
@@ -66,11 +66,37 @@ if [ "$CIRCLECI" == "true" ]; then
|
|
|
66
66
|
initialize_gcloud
|
|
67
67
|
fi
|
|
68
68
|
|
|
69
|
+
# Attempt to grab org name from git remote origin
|
|
70
|
+
git_orgname=`git config --get remote.origin.url | cut -d ":" -f 2 | cut -d "/" -f 1`
|
|
71
|
+
|
|
72
|
+
# Set project based on org name
|
|
73
|
+
printf "\nDetecting organization name...\n"
|
|
74
|
+
|
|
75
|
+
if [ "$git_orgname" = "leverege" ]; then
|
|
76
|
+
printf "\nUsing leverege\n\n"
|
|
77
|
+
gcp_project=leverege-docker-images
|
|
78
|
+
elif [ "$git_orgname" = "cox2m" ]; then
|
|
79
|
+
printf "\nUsing cox2m\n\n"
|
|
80
|
+
gcp_project=cox2m-docker-images
|
|
81
|
+
else
|
|
82
|
+
printf "\nDid not recognize organization name...\n"
|
|
83
|
+
printf "\nDefaulting to leverege\n\n"
|
|
84
|
+
gcp_project=leverege-docker-images
|
|
85
|
+
fi
|
|
86
|
+
|
|
87
|
+
# decrypt .env.enc file
|
|
88
|
+
gcloud kms decrypt \
|
|
89
|
+
--project $gcp_project \
|
|
90
|
+
--key circle-ci \
|
|
91
|
+
--keyring build-tools \
|
|
92
|
+
--location us-east4 \
|
|
93
|
+
--plaintext-file .env \
|
|
94
|
+
--ciphertext-file .env.enc
|
|
69
95
|
|
|
70
96
|
if [ -f "secrets.tar.gz.enc" ]; then
|
|
71
97
|
# decrypt the secrets.tar.gz.enc
|
|
72
98
|
gcloud kms decrypt \
|
|
73
|
-
--project
|
|
99
|
+
--project $gcp_project \
|
|
74
100
|
--key circle-ci \
|
|
75
101
|
--keyring build-tools \
|
|
76
102
|
--location us-east4 \
|
|
@@ -79,13 +105,4 @@ if [ -f "secrets.tar.gz.enc" ]; then
|
|
|
79
105
|
|
|
80
106
|
# untar secrets.tar.gz
|
|
81
107
|
tar xvzf secrets.tar.gz
|
|
82
|
-
fi
|
|
83
|
-
|
|
84
|
-
# decrypt .env.enc file
|
|
85
|
-
gcloud kms decrypt \
|
|
86
|
-
--project leverege-docker-images \
|
|
87
|
-
--key circle-ci \
|
|
88
|
-
--keyring build-tools \
|
|
89
|
-
--location us-east4 \
|
|
90
|
-
--plaintext-file .env \
|
|
91
|
-
--ciphertext-file .env.enc
|
|
108
|
+
fi
|
package/src/dockreate
CHANGED
|
@@ -312,7 +312,7 @@ echo "Creating Docker Image for $gcimage:$version"
|
|
|
312
312
|
echo " Building the workspace"
|
|
313
313
|
|
|
314
314
|
# use kaniko to cache builds
|
|
315
|
-
gcloud config set builds/use_kaniko True
|
|
315
|
+
[ "$USE_KANIKO" == "yes" ] && gcloud config set builds/use_kaniko True
|
|
316
316
|
|
|
317
317
|
# submit the build request to gcloud
|
|
318
318
|
gcloud builds submit --tag $gcimage:$version .
|
package/src/encrypt-secrets
CHANGED
|
@@ -9,23 +9,41 @@ if [ "$1" == "-h" ]; then
|
|
|
9
9
|
exit 1
|
|
10
10
|
fi
|
|
11
11
|
|
|
12
|
+
# Attempt to grab org name from git remote origin
|
|
13
|
+
git_orgname=`git config --get remote.origin.url | cut -d ":" -f 2 | cut -d "/" -f 1`
|
|
14
|
+
|
|
15
|
+
# Set project based on org name
|
|
16
|
+
printf "\nDetecting organization name...\n"
|
|
17
|
+
|
|
18
|
+
if [ "$git_orgname" = "leverege" ]; then
|
|
19
|
+
printf "\nUsing leverege\n\n"
|
|
20
|
+
gcp_project=leverege-docker-images
|
|
21
|
+
elif [ "$git_orgname" = "cox2m" ]; then
|
|
22
|
+
printf "\nUsing cox2m\n\n"
|
|
23
|
+
gcp_project=cox2m-docker-images
|
|
24
|
+
else
|
|
25
|
+
printf "\nDid not recognize organization name...\n"
|
|
26
|
+
printf "\nDefaulting to leverege\n\n"
|
|
27
|
+
gcp_project=leverege-docker-images
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
# encrypt .env file
|
|
31
|
+
gcloud kms encrypt --project $gcp_project \
|
|
32
|
+
--key circle-ci \
|
|
33
|
+
--keyring build-tools \
|
|
34
|
+
--location us-east4 \
|
|
35
|
+
--plaintext-file .env \
|
|
36
|
+
--ciphertext-file .env.enc
|
|
37
|
+
|
|
12
38
|
if [ -d "secrets" ]; then
|
|
13
39
|
# tar up secrets directory
|
|
14
40
|
tar -zcvf secrets.tar.gz secrets
|
|
15
41
|
# encrypt secrets file
|
|
16
42
|
gcloud kms encrypt \
|
|
17
|
-
--project
|
|
43
|
+
--project $gcp_project \
|
|
18
44
|
--key circle-ci \
|
|
19
45
|
--keyring build-tools \
|
|
20
46
|
--location us-east4 \
|
|
21
47
|
--plaintext-file secrets.tar.gz \
|
|
22
48
|
--ciphertext-file secrets.tar.gz.enc
|
|
23
|
-
fi
|
|
24
|
-
|
|
25
|
-
# encrypt .env file
|
|
26
|
-
gcloud kms encrypt --project leverege-docker-images \
|
|
27
|
-
--key circle-ci \
|
|
28
|
-
--keyring build-tools \
|
|
29
|
-
--location us-east4 \
|
|
30
|
-
--plaintext-file .env \
|
|
31
|
-
--ciphertext-file .env.enc
|
|
49
|
+
fi
|