@leverege/build-tools 2.18.0-beta.12 → 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.12",
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",
@@ -56,49 +56,33 @@ 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}
59
+ function decryptEnvToPipeline() {
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 $GCLOUD_PROJECT \
66
+ --project $GOOGLE_PROJECT \
74
67
  --key circle-ci \
75
68
  --keyring build-tools \
76
- --location $GCLOUD_COMPUTE_ZONE \
69
+ --location $GOOGLE_COMPUTE_ZONE \
77
70
  --plaintext-file .env \
78
71
  --ciphertext-file .env.enc
79
72
 
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
73
+ exit $?
74
+ }
96
75
 
97
76
  if [ "$1" == "-h" ]; then
98
77
  display_usage
99
78
  exit 1
100
79
  fi
101
80
 
81
+ if [ "$BITBUCKETCI" == "true" ];
82
+ then
83
+ decryptEnvToPipeline
84
+ fi
85
+
102
86
  if [ "$CIRCLECI" == "true" ]; then
103
87
  install_gcloud
104
88
  initialize_gcloud
@@ -113,7 +97,7 @@ else
113
97
  fi
114
98
 
115
99
  # Set project based on org name
116
- printf "\nSON OF A BITCH XXX - Detecting organization name...\n"
100
+ printf "\nDetecting organization name...\n"
117
101
 
118
102
  if [ "$git_orgname" = "leverege" ]; then
119
103
  printf "\nUsing leverege\n\n"
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 $gcimage:latest
405
+ gcloud container images add-tag --quiet $gcimage:$version $gcimage:$pckgdts-$nodeimg-$USER
406
406
  if [ ! -z "$artifact" ];
407
407
  then
408
408
  cat<<END_ARTY