@leverege/build-tools 2.18.0-pipe.1 → 2.18.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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.18.0-pipe.1",
3
+ "version": "2.18.1",
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",
@@ -56,6 +56,44 @@ initialize_gcloud() {
56
56
  gcloud --quiet config set compute/zone ${GOOGLE_COMPUTE_ZONE}
57
57
  }
58
58
 
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
64
+ printf " GCLOUD_PROJECT [$GCLOUD_PROJECT]\n"
65
+ printf " GCLOUD_COMPUTE_ZONE [$GCLOUD_COMPUTE_ZONE]\n"
66
+
67
+ gcloud --quiet config set project ${GCLOUD_PROJECT}
68
+ gcloud --quiet config set compute/zone ${GCLOUD_COMPUTE_ZONE}
69
+ echo ${GCLOUD_SERVICE_KEY} | gcloud auth activate-service-account --key-file=-
70
+
71
+ # decrypt .env.enc file
72
+ gcloud kms decrypt \
73
+ --project $GCLOUD_PROJECT \
74
+ --key circle-ci \
75
+ --keyring build-tools \
76
+ --location $GCLOUD_COMPUTE_ZONE \
77
+ --plaintext-file .env \
78
+ --ciphertext-file .env.enc
79
+
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
96
+
59
97
  if [ "$1" == "-h" ]; then
60
98
  display_usage
61
99
  exit 1
@@ -110,4 +148,4 @@ if [ -f "secrets.tar.gz.enc" ]; then
110
148
 
111
149
  # untar secrets.tar.gz
112
150
  tar xvzf secrets.tar.gz
113
- fi
151
+ fi
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
@@ -1,14 +0,0 @@
1
- #!/bin/bash
2
-
3
- gcloud --quiet config set project ${GOOGLE_PROJECT}
4
- gcloud --quiet config set compute/zone ${GOOGLE_COMPUTE_ZONE}
5
- echo ${GCLOUD_SERVICE_KEY} | gcloud auth activate-service-account --key-file=-
6
-
7
- # decrypt .env.enc file
8
- gcloud kms decrypt \
9
- --project $GOOGLE_PROJECT \
10
- --key circle-ci \
11
- --keyring build-tools \
12
- --location $GOOGLE_COMPUTE_ZONE \
13
- --plaintext-file .env \
14
- --ciphertext-file .env.enc