@leverege/build-tools 2.18.0-beta.10 → 2.18.0-beta.12

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.10",
3
+ "version": "2.18.0-beta.12",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -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
@@ -57,13 +56,14 @@ initialize_gcloud() {
57
56
  gcloud --quiet config set compute/zone ${GOOGLE_COMPUTE_ZONE}
58
57
  }
59
58
 
60
- function decryptEnvToPipeline() {
61
- 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
62
64
  printf " GCLOUD_PROJECT [$GCLOUD_PROJECT]\n"
63
65
  printf " GCLOUD_COMPUTE_ZONE [$GCLOUD_COMPUTE_ZONE]\n"
64
66
 
65
- install_gcloud
66
-
67
67
  gcloud --quiet config set project ${GCLOUD_PROJECT}
68
68
  gcloud --quiet config set compute/zone ${GCLOUD_COMPUTE_ZONE}
69
69
  echo ${GCLOUD_SERVICE_KEY} | gcloud auth activate-service-account --key-file=-
@@ -77,28 +77,33 @@ function decryptEnvToPipeline() {
77
77
  --plaintext-file .env \
78
78
  --ciphertext-file .env.enc
79
79
 
80
- exit $?
81
- }
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
82
96
 
83
97
  if [ "$1" == "-h" ]; then
84
98
  display_usage
85
99
  exit 1
86
100
  fi
87
101
 
88
- printf "\nBITBUCKETCI=[$BITBUCKETCI] CIRCLECI=[$CIRCLECI]\n"
89
-
90
- if [ "$BITBUCKETCI" == "true" ];
91
- then
92
- decryptEnvToPipeline
93
- fi
94
-
95
102
  if [ "$CIRCLECI" == "true" ]; then
96
103
  install_gcloud
97
104
  initialize_gcloud
98
105
  fi
99
106
 
100
- printf "\nXXXXXXXXXX SHOULD NOT BE HERE XXXXXXXXXX\n" && exit 0 # XXX
101
-
102
107
  git_origin=`git config --get remote.origin.url`
103
108
 
104
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