@leverege/build-tools 2.18.0-beta.9 → 2.18.0

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.9",
3
+ "version": "2.18.0",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -56,8 +56,11 @@ initialize_gcloud() {
56
56
  gcloud --quiet config set compute/zone ${GOOGLE_COMPUTE_ZONE}
57
57
  }
58
58
 
59
- function decryptEnvToPipeline() {
60
- printf "______________BitBucket Pipeline Detected______________\n"
59
+ # If this is running from a BitBucket Pipeline then it is assumed that our
60
+ # custom image from the pipeline-image is executing which already has the
61
+ # Google SDK + gcloud installed - so just use it.
62
+ if [ "$BITBUCKETCI" == "true" ];
63
+ then
61
64
  printf " GCLOUD_PROJECT [$GCLOUD_PROJECT]\n"
62
65
  printf " GCLOUD_COMPUTE_ZONE [$GCLOUD_COMPUTE_ZONE]\n"
63
66
 
@@ -74,28 +77,33 @@ function decryptEnvToPipeline() {
74
77
  --plaintext-file .env \
75
78
  --ciphertext-file .env.enc
76
79
 
77
- exit $?
78
- }
80
+ if [ -f "secrets.tar.gz.enc" ]; then
81
+ # decrypt the secrets.tar.gz.enc
82
+ gcloud kms decrypt \
83
+ --project $GCLOUD_PROJECT \
84
+ --key circle-ci \
85
+ --keyring build-tools \
86
+ --location $GCLOUD_COMPUTE_ZONE \
87
+ --plaintext-file secrets.tar.gz \
88
+ --ciphertext-file secrets.tar.gz.enc
89
+
90
+ # untar secrets.tar.gz
91
+ tar xvzf secrets.tar.gz
92
+ fi
93
+
94
+ exit 0 # may want to improve error report/handling
95
+ fi
79
96
 
80
97
  if [ "$1" == "-h" ]; then
81
98
  display_usage
82
99
  exit 1
83
100
  fi
84
101
 
85
- printf "\nBITBUCKETCI=[$BITBUCKETCI] CIRCLECI=[$CIRCLECI]\n"
86
-
87
- if [ "$BITBUCKETCI" == "true" ];
88
- then
89
- decryptEnvToPipeline
90
- fi
91
-
92
102
  if [ "$CIRCLECI" == "true" ]; then
93
103
  install_gcloud
94
104
  initialize_gcloud
95
105
  fi
96
106
 
97
- printf "\nXXXXXXXXXX SHOULD NOT BE HERE XXXXXXXXXX\n" && exit 0 # XXX
98
-
99
107
  git_origin=`git config --get remote.origin.url`
100
108
 
101
109
  if [[ $git_origin = https* ]]; then
package/src/dockreate CHANGED
@@ -402,7 +402,7 @@ BUILDERR
402
402
  fi
403
403
 
404
404
  # Tag the container with the node detailsand the culprit.
405
- gcloud container images add-tag --quiet $gcimage:$version $gcimage:$pckgdts-$nodeimg-$USER
405
+ gcloud container images add-tag --quiet $gcimage:$version $gcimage:$pckgdts-$nodeimg-$USER $gcimage:latest
406
406
  if [ ! -z "$artifact" ];
407
407
  then
408
408
  cat<<END_ARTY