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

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.3",
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,34 @@ 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
+ echo "------------- BitBucket Pipeline Detected -------------"
61
+ gcloud --quiet config set project ${GOOGLE_PROJECT}
62
+ gcloud --quiet config set compute/zone ${GOOGLE_COMPUTE_ZONE}
69
63
  echo ${GCLOUD_SERVICE_KEY} | gcloud auth activate-service-account --key-file=-
70
64
 
71
65
  # decrypt .env.enc file
72
66
  gcloud kms decrypt \
73
- --project $GCLOUD_PROJECT \
67
+ --project $GOOGLE_PROJECT \
74
68
  --key circle-ci \
75
69
  --keyring build-tools \
76
- --location $GCLOUD_COMPUTE_ZONE \
70
+ --location $GOOGLE_COMPUTE_ZONE \
77
71
  --plaintext-file .env \
78
72
  --ciphertext-file .env.enc
79
73
 
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
74
+ exit $?
75
+ }
96
76
 
97
77
  if [ "$1" == "-h" ]; then
98
78
  display_usage
99
79
  exit 1
100
80
  fi
101
81
 
82
+ if [ "$BITBUCKETCI" == "true" ];
83
+ then
84
+ decryptEnvToPipeline
85
+ fi
86
+
102
87
  if [ "$CIRCLECI" == "true" ]; then
103
88
  install_gcloud
104
89
  initialize_gcloud
@@ -113,7 +98,7 @@ else
113
98
  fi
114
99
 
115
100
  # Set project based on org name
116
- printf "\nSON OF A BITCH XXX - Detecting organization name...\n"
101
+ printf "\nDetecting organization name...\n"
117
102
 
118
103
  if [ "$git_orgname" = "leverege" ]; then
119
104
  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