@leverege/build-tools 2.5.37 → 2.5.39

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.
@@ -8,6 +8,8 @@ const chalk = require('chalk');
8
8
  const cliArgs = require('command-line-args'); // const cliHelp = require( 'command-line-usage' )
9
9
 
10
10
 
11
+ const deepmerge = require('deepmerge');
12
+
11
13
  const exec = require('child_process').execSync;
12
14
 
13
15
  const fs = require('fs');
@@ -270,7 +272,22 @@ ahoy.forEach(dir => {
270
272
  }
271
273
 
272
274
  valuesOut += `\n${values}`;
273
- valuesOut = doReplacements(valuesOut, over);
275
+ valuesOut = doReplacements(valuesOut, over); // If we are going to override then we need to convert it to YAML and
276
+ // do a deepmerge to combine the values.
277
+
278
+ const valuesOverride = `${dir}/values-override.yaml`;
279
+
280
+ if (fs.existsSync(valuesOverride)) {
281
+ console.log(`===>Applying Overrides=> ${valuesOverride}`);
282
+ const overrides = YAML.load(fs.readFileSync(valuesOverride, {
283
+ encofind: 'utf-8'
284
+ }));
285
+ const allValues = YAML.load(valuesOut);
286
+ valuesOut = YAML.dump(deepmerge(allValues, overrides), {
287
+ quotingType: '"'
288
+ });
289
+ }
290
+
274
291
  fs.writeFileSync(`${dir}/values.yaml`, valuesOut);
275
292
  }
276
293
  }); // we can also apply replaceables to any top level .ovh files to support top level config maps
Binary file
@@ -60,7 +60,7 @@ const build = async buildSpec => {
60
60
  console.log(`${chalk.keyword('orange').bold(`
61
61
  Before proceeding you will want to verify that your browser has access to the
62
62
  git hosting service you are about to use. The easiest way to do this is to
63
- simply open a browser window on bitbuck or github with the desired account.
63
+ simply open a browser window on bitbucket or github with the desired account.
64
64
 
65
65
  Once you proceed from this step a browser window will be opened and you will
66
66
  enter the relevant information into the repository creation page. Click the
@@ -116,7 +116,7 @@ class Templates {
116
116
  type: 'confirm',
117
117
  name: 'template.helmify',
118
118
  message: 'Run helmify to generate Helm Charts?',
119
- default: false,
119
+ default: true,
120
120
  when: answers => {
121
121
  const template = this.lookupTemplateByType(answers.template.type);
122
122
  return typeof template.helm !== 'undefined';
@@ -8,6 +8,8 @@ const chalk = require('chalk');
8
8
  const cliArgs = require('command-line-args'); // const cliHelp = require( 'command-line-usage' )
9
9
 
10
10
 
11
+ const deepmerge = require('deepmerge');
12
+
11
13
  const exec = require('child_process').execSync;
12
14
 
13
15
  const fs = require('fs');
@@ -270,7 +272,22 @@ ahoy.forEach(dir => {
270
272
  }
271
273
 
272
274
  valuesOut += `\n${values}`;
273
- valuesOut = doReplacements(valuesOut, over);
275
+ valuesOut = doReplacements(valuesOut, over); // If we are going to override then we need to convert it to YAML and
276
+ // do a deepmerge to combine the values.
277
+
278
+ const valuesOverride = `${dir}/values-override.yaml`;
279
+
280
+ if (fs.existsSync(valuesOverride)) {
281
+ console.log(`===>Applying Overrides=> ${valuesOverride}`);
282
+ const overrides = YAML.load(fs.readFileSync(valuesOverride, {
283
+ encofind: 'utf-8'
284
+ }));
285
+ const allValues = YAML.load(valuesOut);
286
+ valuesOut = YAML.dump(deepmerge(allValues, overrides), {
287
+ quotingType: '"'
288
+ });
289
+ }
290
+
274
291
  fs.writeFileSync(`${dir}/values.yaml`, valuesOut);
275
292
  }
276
293
  }); // we can also apply replaceables to any top level .ovh files to support top level config maps
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.5.37",
3
+ "version": "2.5.39",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -50,34 +50,35 @@
50
50
  "author": "Leverege Devs",
51
51
  "license": "SEE LICENSE IN LICENSE.md",
52
52
  "dependencies": {
53
- "chalk": "^4.1.0",
53
+ "chalk": "^4.1.1",
54
54
  "clear": "^0.1.0",
55
55
  "clipboardy": "^2.3.0",
56
56
  "command-line-args": "^5.1.1",
57
57
  "command-line-usage": "^6.1.1",
58
- "dotenv": "^8.2.0",
58
+ "dotenv": "^9.0.2",
59
59
  "execa": "^5.0.0",
60
60
  "figlet": "^1.5.0",
61
61
  "git-branch": "^2.0.1",
62
- "glob": "^7.1.6",
62
+ "glob": "^7.1.7",
63
63
  "inquirer": "^7.3.3",
64
- "js-yaml": "^4.0.0",
64
+ "js-yaml": "^4.1.0",
65
+ "kubernetes-client": "^9.0.0",
65
66
  "ncp": "^2.0.0",
66
- "npm-check-updates": "^11.4.1",
67
+ "npm-check-updates": "^11.5.12",
67
68
  "npm-registry-fetch": "^9.0.0",
68
- "open": "^7.4.2",
69
+ "open": "^8.0.8",
69
70
  "ora": "^5.4.0",
70
71
  "parse-gitignore": "^1.0.1",
71
72
  "readline-sync": "^1.4.10",
72
73
  "semver": "^7.3.5",
73
- "simple-git": "^2.37.0"
74
+ "simple-git": "^2.39.0"
74
75
  },
75
76
  "devDependencies": {
76
- "@babel/cli": "^7.13.14",
77
- "@babel/core": "^7.13.15",
78
- "@babel/node": "^7.13.13",
77
+ "@babel/cli": "^7.13.16",
78
+ "@babel/core": "^7.14.2",
79
+ "@babel/node": "^7.14.2",
79
80
  "@leverege/babel-preset-leverege-node": "^1.1.1",
80
81
  "@leverege/eslint-config-leverege": "^2.2.0",
81
- "npm": "^7.9.0"
82
+ "npm": "^7.13.0"
82
83
  }
83
84
  }
package/src/dockreate CHANGED
@@ -75,7 +75,7 @@ COPY ./.npmrc /usr/src/app/.npmrc
75
75
  RUN apk --no-cache add curl git openssh-client && \
76
76
  apk --update add --no-cache --virtual build-dep g++ gcc libgcc \\
77
77
  libstdc++ linux-headers make python ${apkadds} && \
78
- npm install --production --silent && \
78
+ npm ci --production --silent && \
79
79
  rm -f /usr/src/app/.npmrc /root/.ssh/*
80
80
 
81
81
  # --------------------------------------------------------------
@@ -84,7 +84,7 @@ RUN apk --no-cache add curl git openssh-client && \
84
84
 
85
85
  FROM node:${nodeimg}
86
86
 
87
- # Install tint for PID 1 and replace shell with bash so we can source files
87
+ # Install tini for PID 1 and replace shell with bash so we can source files
88
88
  RUN apk update && \
89
89
  apk add --no-cache tini bash vim ${apkadds} && \
90
90
  rm /bin/sh && ln -s /bin/bash /bin/sh && \
@@ -331,8 +331,7 @@ fi
331
331
  create_Dockerfile "$version" "$nodeimg" "$apkadds"
332
332
  create_bashrc "$version" "$nodeimg"
333
333
 
334
- [ -d ./workspace ] && rm -rf ./workspace
335
- mkdir -p ./workspace
334
+ rm -rf ./workspace && mkdir -p ./workspace
336
335
  cp -rfp ../package*json ../dist/* ./workspace
337
336
 
338
337
  # grab the read only npmrc token for the image
@@ -359,7 +358,7 @@ else
359
358
  fi
360
359
 
361
360
  # submit the build request to gcloud
362
- gcloud builds submit --tag $gcimage:$version .
361
+ time gcloud builds submit --tag $gcimage:$version .
363
362
 
364
363
  if [ $? -ne 0 ];
365
364
  then
package/src/helmup CHANGED
@@ -118,7 +118,11 @@ SA_EXISTS
118
118
 
119
119
  # Verify the Kubernetes SA
120
120
  kubectl get sa -n monitoring $SDEXP_SA
121
- exitOnError $? "The $SDEXP_SA SA seems to be missing"
121
+ if [[ $? -eq 1 ]];
122
+ then
123
+ printf "The $SDEXP_SA SA seems to be missing, which is weird - creating it now\n"
124
+ kubectl create sa -n monitoring stackdriver-exporter
125
+ fi
122
126
 
123
127
  # NOTE: The k8s SA != GCP SA - the former is created by the helm chart
124
128
  # that installs the stackdriver-exporter, the latter is handled here in
@@ -394,7 +398,7 @@ function ifPluggedIn() {
394
398
  if [ ! -x $PLUGIN ];
395
399
  then
396
400
  cat<<PLUGIN_NOEXEC
397
- $RED_ERROR The plugin file is preset but is not executable.
401
+ $RED_ERROR The plugin file is present but is not executable.
398
402
  Try running => `color y "chmod +x $PLUGIN"`
399
403
 
400
404
  PLUGIN_NOEXEC
package/src/klog CHANGED
@@ -4,11 +4,12 @@
4
4
 
5
5
  DTS="`date +\"%Y%m%d-%H%M%S\"`"
6
6
  PRETTY="pino-pretty -c -t 'HH:MM:ss.l'"
7
+ IFS="/" read APP <<< "$1"
7
8
 
8
- if [ ! -z "$1" ];
9
+ if [ ! -z "$APP" ];
9
10
  then
10
11
  NS=${2:-"default"}
11
- kubecmd="kubectl logs -f -n $NS -l app=$1 -c $1 | pino-pretty -c -t hh:mm:ss.l"
12
+ kubecmd="kubectl logs -f -n $NS --max-log-requests=16 -l app=$APP -c $APP | tee $APP-$DTS.log | $PRETTY"
12
13
  echo " run=[$kubecmd]"
13
14
  eval ${kubecmd}
14
15
  exit $?
package/src/overwhelm.js CHANGED
@@ -5,6 +5,7 @@
5
5
  const chalk = require( 'chalk' )
6
6
  const cliArgs = require( 'command-line-args' )
7
7
  // const cliHelp = require( 'command-line-usage' )
8
+ const deepmerge = require( 'deepmerge' )
8
9
  const exec = require( 'child_process' ).execSync
9
10
  const fs = require( 'fs' )
10
11
  const glob = require( 'glob' )
@@ -225,6 +226,17 @@ ahoy.forEach( ( dir ) => {
225
226
  valuesOut += `\n${values}`
226
227
  valuesOut = doReplacements( valuesOut, over )
227
228
 
229
+ // If we are going to override then we need to convert it to YAML and
230
+ // do a deepmerge to combine the values.
231
+ const valuesOverride = `${dir}/values-override.yaml`
232
+
233
+ if( fs.existsSync( valuesOverride ) ) {
234
+ console.log( `===>Applying Overrides=> ${valuesOverride}` )
235
+ const overrides = YAML.load( fs.readFileSync( valuesOverride, { encofind : 'utf-8' } ))
236
+ const allValues = YAML.load( valuesOut )
237
+ valuesOut = YAML.dump( deepmerge( allValues, overrides ), { quotingType : '"' } )
238
+ }
239
+
228
240
  fs.writeFileSync( `${dir}/values.yaml`, valuesOut )
229
241
  }
230
242
  } )
package/CHANGELOG.md DELETED
@@ -1,46 +0,0 @@
1
- # Changelog
2
- All notable changes to this project will be documented in this file.
3
-
4
- ## [2.3.1] = 2020-05-10
5
- ### Updated
6
- - (Circleate) Updated support for UI circle config
7
-
8
- ## [2.2.3] = 2020-04-22
9
- ### Updated
10
- - (Helmify) Added a CLI interface for Helmup
11
-
12
- ## [2.1.5] - 2020-03-08
13
- ### Updated
14
- - (Helmup) Simplified Timescale installation process
15
-
16
- ## [2.0.0] - 2020-02-12
17
- ### Added
18
- - (encrypt/decrypt) Allow for external KMS (BREAKING!!!)
19
-
20
- ## [1.6.3] - 2019-07-02
21
- ### Added
22
- - (pkglint) Added pkglint check for valid files
23
-
24
- ## [1.5.0] - 2019-06-07
25
- ### Added
26
- - (Dnsify) Added new Dnsify script to add new DNS records to cloudflare
27
-
28
- ## [1.4.0] - 2019-05-02
29
- ### Added
30
- - (Helmify) Added new Helmify script to bootstrap helm templates
31
-
32
- ## [0.7.1] - 2019-03-07
33
- ### Updated
34
- - (Overwhelm) Replaced glob library to fix vulnerability issue
35
-
36
- ## [0.5.0] - 2019-03-04
37
- ### Replaced
38
- - (Encrypt/Decrypt) Deprecate OpenSSL for GCP KMS encryption method
39
-
40
- ## [0.4.0] - 2019-02-21
41
- ### Added
42
- - (Circleate) Added smoke test step to do security audit
43
- - (Circleate) Account for edge cases with non-standard container name
44
-
45
- ### Removed
46
- - (Circleate) Deleted junit reporter for test coverage