@leverege/build-tools 2.51.0-beta.2 → 2.51.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.51.0-beta.2",
3
+ "version": "2.51.0",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -20,7 +20,6 @@
20
20
  "decrypt-secrets": "src/decrypt-secrets.sh",
21
21
  "dirty-git": "src/dirty-git.sh",
22
22
  "dockreate": "src/dockreate.sh",
23
- "documentate" : "src/documentate.sh",
24
23
  "docker-to-registry": "src/docker-to-registry.mjs",
25
24
  "docker-to-registry.sh": "src/docker-to-registry.sh",
26
25
  "encrypt-secrets": "src/encrypt-secrets.sh",
@@ -58,27 +57,27 @@
58
57
  "@google-cloud/artifact-registry": "^3.4.0",
59
58
  "ansi-colors": "^4.1.3",
60
59
  "chalk": "^5.3.0",
61
- "command-line-args": "^5.2.1",
62
- "command-line-usage": "^7.0.1",
60
+ "command-line-args": "^6.0.0",
61
+ "command-line-usage": "^7.0.2",
63
62
  "deepmerge": "^4.3.1",
64
63
  "enquirer": "^2.4.1",
65
- "execa": "^9.1.0",
66
- "glob": "^10.3.16",
64
+ "execa": "^9.3.0",
65
+ "glob": "^11.0.0",
67
66
  "handlebars": "^4.7.8",
68
- "inquirer": "^9.2.22",
67
+ "inquirer": "^10.0.1",
69
68
  "js-yaml": "^4.1.0",
70
69
  "ms": "^2.1.3",
71
- "npm-registry-fetch": "^17.0.1",
70
+ "npm-registry-fetch": "^17.1.0",
72
71
  "package-up": "^5.0.0",
73
72
  "parse-gitignore": "^2.0.0",
74
73
  "read-pkg": "^9.0.1",
75
74
  "readline-sync": "^1.4.10",
76
75
  "semver": "^7.6.2",
77
- "simple-git": "^3.24.0",
78
- "zx": "^8.1.1"
76
+ "simple-git": "^3.25.0",
77
+ "zx": "^8.1.4"
79
78
  },
80
79
  "devDependencies": {
81
80
  "@leverege/eslint-config-leverege": "^4.2.0",
82
- "npm": "^10.8.0"
81
+ "npm": "^10.8.2"
83
82
  }
84
83
  }
@@ -0,0 +1,20 @@
1
+ registry:
2
+ - root: us-docker.pkg.dev
3
+ - repositories:
4
+ - name: stack
5
+ charts:
6
+ - api-server
7
+ - authz-server
8
+ - emailer
9
+ - message-processor
10
+ - name: leverege
11
+ charts:
12
+ - pubsub-pulse
13
+ - pusher
14
+ - overdose
15
+ - name: cox-health
16
+ charts:
17
+ - actions-server
18
+ - analytics-server
19
+ - centrak-healthz
20
+ - centrak-ingestor
package/src/Utils.mjs CHANGED
@@ -7,7 +7,9 @@ import { glob } from 'glob'
7
7
  import { packageUp } from 'package-up'
8
8
  import YAML from 'js-yaml'
9
9
 
10
- const debugEnabled = process.env.BUILD_TOOLS_DEBUG === '1'
10
+ let debugEnabled = process.env.BUILD_TOOLS_DEBUG === '1'
11
+
12
+ export const disableDebug = () => debugEnabled = false
11
13
 
12
14
  /* eslint-disable no-console */
13
15
  export const err = console.error
package/src/bash-funcs CHANGED
@@ -29,8 +29,12 @@ RED_ERROR=`color r '***ERROR:'`
29
29
  YELO_WARN="`color y '***WARNING:'`"
30
30
  GREEN_INFO=`color g '***INFO:'`
31
31
 
32
+ function clearScreen() {
33
+ [ "$BUILD_TOOLS_DEBUG" != "1" ] && clear
34
+ }
35
+
32
36
  function clearlyWarn() {
33
- [ -z "$1" ] && clear
37
+ clearScreen
34
38
  cat<<CLEARWARN
35
39
 
36
40
  `color y '*** WARNING *** WARNING *** WARNING *** WARNING *** WARNING *** WARNING ***'`
@@ -0,0 +1,96 @@
1
+ #!/usr/bin/env node
2
+ /*
3
+ * chart-to-registry will...
4
+ */
5
+ import fs from 'node:fs'
6
+
7
+ import chalk from 'chalk'
8
+ import commandLineArgs from 'command-line-args'
9
+ import commandLineUsage from 'command-line-usage'
10
+ import { lt as semverLt } from 'semver'
11
+ import YAML from 'js-yaml'
12
+
13
+ import {
14
+ condir,
15
+ debug,
16
+ errorExit,
17
+ log,
18
+ warning,
19
+ getGitRootDirectory,
20
+ parsePackageJson,
21
+ parseHelmChart,
22
+ shellCmd } from './Utils.mjs'
23
+
24
+ const commandLineOptions = [ // Use commandLineOptions to tie into the Usage statements
25
+ /* eslint-disable max-len */
26
+ {
27
+ name : 'location',
28
+ type : String,
29
+ description : '{green the location of the artifact registry the chart will be pushed to (default us-docker.pkg.dev)}',
30
+ },
31
+ {
32
+ name : 'project',
33
+ type : String,
34
+ description : '{green the name of the google project containing the npmrc and slack config secrets (default leverege-registry)}',
35
+ },
36
+ {
37
+ name : 'repository',
38
+ type : String,
39
+ description : '{green the target repository to receive the pushed chart}',
40
+ },
41
+ {
42
+ name : 'dry-run',
43
+ type : Boolean,
44
+ description : '{yellow perform everything except the actual chart push}',
45
+ },
46
+ {
47
+ name : 'help',
48
+ type : Boolean,
49
+ description : '{green display this help screen}',
50
+ },
51
+ /* eslint-enable max-len */
52
+ ]
53
+
54
+ const sections = [
55
+ {
56
+ header : 'Leverege Helm Chart Compass (for helmup)',
57
+ content : `{green This tool helps helmup navigate the helm charts stored in the
58
+ artifact-registries.}`
59
+ },
60
+ { header : 'Options',
61
+ optionList : commandLineOptions,
62
+ },
63
+ ]
64
+
65
+ const args = commandLineArgs( commandLineOptions, { camelCase : true, partial : true } )
66
+ const usage = commandLineUsage( sections )
67
+
68
+ if ( args.help ) {
69
+ log( usage )
70
+ process.exit( 0 )
71
+ }
72
+
73
+ /* eslint-disable no-underscore-dangle */
74
+ if ( args._unknown ) {
75
+ log( usage )
76
+ log( `\nUnrecognized argument [${chalk.bold.red( args._unknown )}]\n` )
77
+ process.exit( 1 )
78
+ }
79
+ /* eslint-enable no-underscore-dangle */
80
+
81
+ const minNodejsVersion = '18.0.0'
82
+ if ( semverLt( process.version, minNodejsVersion ) ) {
83
+ errorExit( `\n***ERROR: must be running at least node ${minNodejsVersion}\n` )
84
+ }
85
+
86
+ // First of all, fail if we are not in a git repository
87
+ let gitRoot
88
+ try {
89
+ gitRoot = await getGitRootDirectory()
90
+ } catch ( error ) {
91
+ errorExit( chalk.red.bold( error ), { errorCode : 5 } )
92
+ }
93
+
94
+ const chartCompass = YAML.load( fs.readFileSync( './registry-compass.yaml', 'utf8' ) )
95
+
96
+ condir( { chartCompass }, '<==Navigation' )
package/src/circleate.sh CHANGED
@@ -10,7 +10,6 @@ if [ "$1" != "server" ] && [ "$1" != "ui" ] && [ "$1" != "lib" ]; then
10
10
  fi
11
11
 
12
12
  repo_type=$1
13
- NODE_VERSION="hydrogen"
14
13
  CIRCLE_NODE_IMG="cimg/node:lts"
15
14
 
16
15
  check_circle_config(){
package/src/dockreate.sh CHANGED
@@ -98,7 +98,7 @@ DOCKERPLUGIN
98
98
  # $3 = additional packages to install (htop redis-cli etc)
99
99
  create_Dockerfile() {
100
100
  local regvers="${1}"
101
- local nodeimg="${2:-hydrogen-alpine}"
101
+ local nodeimg="${2:-iron-alpine}"
102
102
  local apkadds="${3}"
103
103
 
104
104
  create_DockerfilePlugin
@@ -236,7 +236,7 @@ fi
236
236
 
237
237
  # TODO: these should be combined into one require
238
238
  nodeimg=$(packageJson '.leverege.nodeimg')
239
- nodeimg="${nodeimg:-hydrogen-alpine}"
239
+ nodeimg="${nodeimg:-iron-alpine}"
240
240
  apkadds=$(packageJson '.leverege.apkadds')
241
241
  runuser=$(packageJson '.leverege.runuser')
242
242
  [ -z "${runuser}" ] && runuser='node'
package/src/git-tar.sh CHANGED
@@ -1,5 +1,8 @@
1
1
  #!/bin/bash
2
2
 
3
+ # Load the standard helper functions
4
+ . `build-tools --bashfun`
5
+
3
6
  # If it isn't already set use the default ~/work/.gitar
4
7
  #
5
8
  [ -z $GITAR ] && GITAR="${HOME}/.gitar"
@@ -65,12 +68,13 @@ REPO=`basename ${GTOP}`
65
68
  #
66
69
  DTS="`date +\"%Y%m%d-%H%M%S\"`"
67
70
 
68
- TARB=${GITAR}/${REPO}/${DTS}.tar # Craft the target tarball name.
71
+ TARS=${GITAR}/${REPO}
72
+ TARB=${TARS}/${DTS}.tar # Craft the target tarball name.
69
73
 
70
74
  # Now do the work
71
75
  #
72
76
  cd ${GTOP}/..
73
- printf "\n*** Tarring $TARB\n"
77
+ printf "\n*** Tarring `color g $TARB`\n"
74
78
  tar cf $TARB -X $TARX $REPO
75
79
  chmod 0640 $TARB
76
80
 
@@ -84,6 +88,9 @@ then
84
88
  FIZ=xz
85
89
  fi
86
90
 
87
- printf "*** Compressing $TARB.$FIZ (background)\n\n"
91
+ printf "\n*** Compressing `color y $TARB.$FIZ` (background)\n"
88
92
  $ZIPPER $TARB &
93
+
94
+ printf "\n*** Tarballs in `color g ${TARS}`\n\n"
95
+ ls -lh ${TARS}
89
96
  cd - 2>&1 >/dev/null
@@ -1,3 +1,9 @@
1
+ # migrations
2
+ # v5.11.0+
3
+ # - k8x api-server pod
4
+ # - node tools/UpdateESComponentTemplateV2.js
5
+ # - node tools/UpdateESMappingV2.js
6
+ #
1
7
  image:
2
8
  tag: # v5.12.3
3
9
 
@@ -1,3 +1,8 @@
1
+ # migrations
2
+ # v2.1.0+
3
+ # - k8x authz-server
4
+ # - npm run sequelizeRunMigrations
5
+ #
1
6
  image:
2
7
  tag: # v2.1.3
3
8
 
@@ -13,24 +13,35 @@ spec:
13
13
  imageName: us-docker.pkg.dev/leverege-registry/system/images/leverege-pgsql:16.2-cnpg-tsdb2-beta.4
14
14
  bootstrap:
15
15
  initdb:
16
- database: models
16
+ # database: models
17
17
  postInitSQL:
18
+ # - CREATE DATABASE app; # operator expects this
19
+ # - CREATE ROLE app; # and this to exist on restore
20
+ # create the stack databases
18
21
  - CREATE DATABASE authz;
19
22
  - CREATE DATABASE fota;
20
23
  - CREATE DATABASE geotile;
21
24
  - CREATE DATABASE models;
22
25
  - CREATE DATABASE scheduler;
23
- owner: imagine
24
- secret:
25
- name: cnpg-db-psql-stack-imagine-pw # imagine db pw
26
+ # owner: imagine
27
+ # secret:
28
+ # name: cnpg-db-psql-stack-imagine-pw # imagine db pw
26
29
 
27
30
  enableSuperuserAccess: true
28
31
  superuserSecret:
29
32
  name: cnpg-db-psql-stack-postgres-pw # postgres db pw
30
33
 
31
34
  affinity:
32
- # enablePodAntiAffinity: true
33
- # topologyKey: kubernetes.io/hostname # default value
35
+ enablePodAntiAffinity: true
36
+ topologyKey: kubernetes.io/hostname # default value
37
+ nodeAffinity:
38
+ requiredDuringSchedulingIgnoredDuringExecution:
39
+ nodeSelectorTerms:
40
+ - matchExpressions:
41
+ - key: target-env
42
+ operator: In
43
+ values:
44
+ - database
34
45
  tolerations:
35
46
  - key: "database"
36
47
  operator: "Equal"
@@ -83,6 +94,7 @@ spec:
83
94
  cnpgCluster: cnpg-db-psql-stack
84
95
  wal:
85
96
  compression: gzip
97
+ maxParallel: 4
86
98
  ---
87
99
  apiVersion: postgresql.cnpg.io/v1
88
100
  kind: ScheduledBackup
@@ -91,8 +103,9 @@ metadata:
91
103
  namespace: cnpg-operands
92
104
  spec:
93
105
  # https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format
94
- schedule: "0 0 * * * *"
106
+ schedule: "0 0 */12 * * *"
95
107
  cluster:
96
- method: volumeSnapshot
108
+ name: cnpg-db-psql-stack
109
+ method: barmanObjectStore # volumeSnapshot
97
110
  backupOwnerReference: self
98
111
  immediate: true
@@ -19,6 +19,8 @@ spec:
19
19
  postInitTemplateSQL:
20
20
  - CREATE EXTENSION timescaledb;
21
21
  - CREATE EXTENSION jsquery;
22
+ - CREATE DATABASE app; # for the operator restores
23
+ - CREATE ROLE app; # same
22
24
  database: imagine
23
25
  owner: imagine
24
26
  secret:
@@ -94,6 +96,7 @@ spec:
94
96
  cnpgCluster: cnpg-db-tsdb-basic
95
97
  wal:
96
98
  compression: gzip
99
+ maxParallel: 4
97
100
  ---
98
101
  apiVersion: postgresql.cnpg.io/v1
99
102
  kind: ScheduledBackup
@@ -19,6 +19,8 @@ spec:
19
19
  postInitTemplateSQL:
20
20
  - CREATE EXTENSION timescaledb;
21
21
  - CREATE EXTENSION jsquery;
22
+ - CREATE DATABASE app; # for the operator restores
23
+ - CREATE ROLE app; # same
22
24
  database: imagine
23
25
  owner: imagine
24
26
  secret:
@@ -93,6 +95,7 @@ spec:
93
95
  cnpgCluster: cnpg-db-tsdb-dense
94
96
  wal:
95
97
  compression: gzip
98
+ maxParallel: 4
96
99
  ---
97
100
  apiVersion: postgresql.cnpg.io/v1
98
101
  kind: ScheduledBackup
@@ -1,6 +1,5 @@
1
1
  # ONLY EDIT grafana-local.yaml.ovh / grafana-local.yaml is git ignored
2
2
  service:
3
- type: "NodePort"
4
3
  port: "9000"
5
4
 
6
5
  datasources:
@@ -39,7 +38,7 @@ tolerations:
39
38
  effect: "NoSchedule"
40
39
 
41
40
  extraObjects:
42
- - apiVersion: traefik.containo.us/v1alpha1
41
+ - apiVersion: traefik.io/v1alpha1
43
42
  kind: IngressRoute
44
43
  metadata:
45
44
  name: grafana
@@ -4,7 +4,7 @@ showInstalling "Grafana"
4
4
 
5
5
  addHelmRepo grafana https://grafana.github.io/helm-charts
6
6
 
7
- [ -z "$GRAFANA_CHART_VERSION" ] && GRAFANA_CHART_VERSION="7"
7
+ [ -z "$GRAFANA_CHART_VERSION" ] && GRAFANA_CHART_VERSION="8"
8
8
  helm upgrade --install grafana grafana/grafana \
9
9
  --namespace monitoring --create-namespace \
10
10
  --values grafana/grafana-local.yaml \
@@ -4,7 +4,7 @@ showInstalling "Redis"
4
4
 
5
5
  OCI_CHART="oci://registry-1.docker.io/bitnamicharts/redis"
6
6
 
7
- [ -z "$REDIS_CHART_VERSION" ] && REDIS_CHART_VERSION="19.5.0"
7
+ [ -z "$REDIS_CHART_VERSION" ] && REDIS_CHART_VERSION="19.6.1"
8
8
 
9
9
  helm upgrade --install redis $OCI_CHART \
10
10
  --values redis/redis-local.yaml \
@@ -25,6 +25,11 @@ master:
25
25
  persistence:
26
26
  size: 8Gi # 8Gi is default
27
27
 
28
+ resources:
29
+ requests:
30
+ cpu: 250m
31
+ memory: 500Mi
32
+
28
33
  replica:
29
34
  affinity:
30
35
  nodeAffinity:
@@ -45,6 +50,11 @@ replica:
45
50
  persistence:
46
51
  size: 8Gi # 8Gi is default
47
52
 
53
+ resources:
54
+ requests:
55
+ cpu: 250m
56
+ memory: 500Mi
57
+
48
58
  architecture: replication
49
59
 
50
60
  sentinel:
@@ -1,5 +1,7 @@
1
1
  # migrations
2
- # v1.2+ run => npm run sequelizeRunMigrations
2
+ # v1.2+
3
+ # - k8x resource-server
4
+ # - npm run sequelizeRunMigrations
3
5
  #
4
6
  image:
5
7
  tag: # v1.2.2
@@ -1,5 +1,5 @@
1
1
  image:
2
- tag: # v2.3.0
2
+ tag: # v2.3.1
3
3
 
4
4
  config:
5
5
  LOG_CONFIG: '{"type":"pino","level":"warn"}'
@@ -5,7 +5,11 @@
5
5
  # ***REMEMBER*** the instructions provided on the internet typically assume
6
6
  # the default namespace not traefik
7
7
  #
8
- # ***DO NOT FORGET*** the -n traefik for kubectl commands
8
+ # ***DO NOT FORGET*** the -n traefik for kubectl commands - so in order to
9
+ # move beyond v20 of the chart run the kubectl command below before upgrading
10
+ #
11
+ # kubectl apply --namespace traefik --server-side \
12
+ # --force-conflicts -k https://github.com/traefik/traefik-helm-chart/traefik/crds/\?ref\=v27
9
13
  #
10
14
  showInstalling "Traefik Load Balancer / Router"
11
15
 
@@ -4,7 +4,7 @@ showInstalling "Velero Backup System"
4
4
 
5
5
  addHelmRepo vmware-tanzu https://vmware-tanzu.github.io/helm-charts
6
6
 
7
- [ -z "$VELERO_CHART_VERSION" ] && VELERO_CHART_VERSION="6"
7
+ [ -z "$VELERO_CHART_VERSION" ] && VELERO_CHART_VERSION="7"
8
8
  #
9
9
  # Build the bucket, region and SA email variables and use --set to mod the
10
10
  # chart values as opposed to using an OVH:<label> approach. This eliminates
@@ -99,9 +99,10 @@ nodeSelector: {}
99
99
 
100
100
  # Init containers to add to the Velero deployment's pod spec. At least one plugin provider image is required.
101
101
  # If the value is a string then it is evaluated as a template.
102
+ # See => https://github.com/vmware-tanzu/velero-plugin-for-gcp
102
103
  initContainers:
103
104
  - name: velero-plugin-for-gcp
104
- image: velero/velero-plugin-for-gcp:v1.5.0
105
+ image: velero/velero-plugin-for-gcp:v1.10.0
105
106
  volumeMounts:
106
107
  - mountPath: /target
107
108
  name: plugins
package/src/helmup.sh CHANGED
@@ -666,7 +666,7 @@ function installVeleroEnvironment() {
666
666
  gcloud config set project $GCP_PROJECT_ID
667
667
 
668
668
  ## The major chart version will determine the bucket suffix
669
- [ -z "$VELERO_HELM_CHART" ] && VELERO_HELM_CHART="6"
669
+ [ -z "$VELERO_HELM_CHART" ] && VELERO_HELM_CHART="7"
670
670
 
671
671
  ## Create a bucket
672
672
  BUCKET="$GCP_PROJECT_ID-velero-$VELERO_HELM_CHART"
@@ -696,6 +696,7 @@ function installVeleroEnvironment() {
696
696
  compute.disks.get
697
697
  compute.disks.create
698
698
  compute.disks.createSnapshot
699
+ compute.projects.get
699
700
  compute.snapshots.get
700
701
  compute.snapshots.create
701
702
  compute.snapshots.useReadOnly
@@ -787,7 +788,27 @@ DEPRECATED_CHART
787
788
  fi
788
789
  }
789
790
 
790
- doHelmup() {
791
+ function checkUpgradeNotes() {
792
+ UPNOTES="$1/helmup.upgrade"
793
+
794
+ [ ! -f "$UPNOTES" ] && return
795
+
796
+ cat<<UPGRADE_NOTES
797
+
798
+ `color g "*** $SERVICE upgrade instructions before moving forward ***"`
799
+
800
+ UPGRADE_NOTES
801
+ cat $UPNOTES
802
+ yesToContinue
803
+ cat<<UPGRADES_DONE
804
+
805
+ `color y "*** Remember to remove $UPNOTES once the steps are performed ***"`
806
+
807
+ UPGRADES_DONE
808
+ sleep 3
809
+ }
810
+
811
+ function doHelmup() {
791
812
  local helmup="$@"
792
813
  local doing="Helming => `color g \"$helmup\"`"
793
814
  local from=
@@ -1036,6 +1057,8 @@ NO_SERVICE_MAN
1036
1057
  fi
1037
1058
  service-man --from-helmup --create-service $SERVICE
1038
1059
 
1060
+ checkUpgradeNotes $SERVICE
1061
+
1039
1062
  # By default the museum chart name will be the same as the service, but
1040
1063
  # we have the flexibility to override the naming when the charts are
1041
1064
  # reference by the downstream repositories via the .helmup-charmuseum file.
package/src/k8scale.sh CHANGED
@@ -19,8 +19,11 @@ case $DIRECTION in
19
19
  REPLICAS=0
20
20
  DIRECTION=down
21
21
  ;;
22
+ roll)
23
+ DIRECTION=roll
24
+ ;;
22
25
  *)
23
- printf "Usage: `color g 'k8scale <up|dn|down> [deployment-list]'`\n\n" && exit 1
26
+ printf "Usage: `color g 'k8scale <up|dn|down|roll> [deployment-list]'`\n\n" && exit 1
24
27
  esac
25
28
 
26
29
  printf " scaled => `color g $DIRECTION`\n\n"
@@ -28,7 +31,12 @@ for DEPLOYMENT in "$@";
28
31
  do
29
32
  IFS="/" read SERVICE <<< "$DEPLOYMENT" # strip trailing /
30
33
  RESULTS="`color g SUCCESS`"
31
- kubectl scale --replicas=$REPLICAS deployment $SERVICE &>/dev/null
34
+ if [ "$DIRECTION" == "roll" ];
35
+ then
36
+ kubectl rollout restart deployment $SERVICE &> $DEVNULL
37
+ else
38
+ kubectl scale --replicas=$REPLICAS deployment $SERVICE &> $DEVNULL
39
+ fi
32
40
  [ $? -eq 1 ] && RESULTS="`color r FAILURE`"
33
41
  printf " $RESULTS => $SERVICE\n"
34
42
  sendToSlack "k8scale $DIRECTION $SERVICE"
package/src/overwhelm.mjs CHANGED
@@ -15,7 +15,7 @@ import parse from 'parse-gitignore'
15
15
  import ask from 'readline-sync'
16
16
  import YAML from 'js-yaml'
17
17
 
18
- import { debug, err, log, shellCmd } from './Utils.mjs'
18
+ import { debug, disableDebug, err, log, shellCmd } from './Utils.mjs'
19
19
 
20
20
  const optionsDefinitions = [
21
21
  /* eslint-disable no-multi-spaces */
@@ -33,6 +33,9 @@ const optionsDefinitions = [
33
33
  ]
34
34
  const args = cliArgs( optionsDefinitions )
35
35
 
36
+ // when using --key we only want the key contents w/o debug info
37
+ if ( args.key ) { disableDebug() }
38
+
36
39
  // See if we are in a monorepo, which changes some of the rules.
37
40
  const gitTop = await shellCmd( 'git rev-parse --show-toplevel' )
38
41
 
@@ -64,10 +67,21 @@ if ( !fs.existsSync( 'overwhelm.yaml' ) ) {
64
67
  if ( fs.existsSync( 'values-default.yaml' ) ) {
65
68
  log( chalk.red.bold( `
66
69
 
67
- ***ERROR overwhelm => values-default.yaml is no longer used/supported
68
- all defaults should be set in default-configs.yaml.ovh
70
+ ***ERROR overwhelm => values-default.yaml is no longer used/supported and will
71
+ be ignored - all defaults should be set in default-configs.yaml.ovh
69
72
  ` ) )
70
- process.exit( 1 )
73
+
74
+ const ans = ask.question( `Enter "${chalk.bold.red( 'skip' )}" if you wish to ignore and continue => ` )
75
+ if ( ans !== 'skip' ) {
76
+ process.exit( 1 )
77
+ }
78
+ }
79
+
80
+ // Avoid race condition when running overwhelm for the first time on a new
81
+ // cluster and the default-configs.yaml file has yet to be created.
82
+ const defaultConfigs = 'default-configs.yaml'
83
+ if ( !fs.existsSync( defaultConfigs ) ) {
84
+ fs.closeSync( fs.openSync( defaultConfigs, 'w' ) ) // same as unix touch
71
85
  }
72
86
 
73
87
  // Load the default values and then overlay with the project specific yaml
@@ -197,7 +211,7 @@ const doReplacements = ( yamls, replacements ) => {
197
211
 
198
212
  // Collect all of the yaml from the yams...
199
213
  const buildYaml = ( yamls, replacements ) => {
200
- const always = [ 'default-configs.yaml' ]
214
+ const always = [ defaultConfigs ]
201
215
  const values = [ ...always, ...yamls ]
202
216
  const loaded = []
203
217
  let allYamls = ''
@@ -1,38 +0,0 @@
1
- #!/bin/bash
2
-
3
- . `build-tools --bashfun`
4
-
5
- cwd=$(pwd)
6
- library=`basename $cwd`
7
- version=$(node -p "require('$cwd/package.json').version")
8
-
9
- echo $library
10
- echo $version
11
-
12
- bucket_name="leverege-registry-jsdocs"
13
-
14
- echo "deploying version $version docs to google cloud storage"
15
-
16
- echo "Check if build exists in root directory (current ver)"
17
-
18
- exists=`gsutil ls -b gs://$bucket_name/$library/$version`
19
- if [[ $exists == gs://* ]]; then
20
- echo "documentation already exists"
21
- exit
22
- fi
23
-
24
- npm run cleanDocs &> $DEVNULL
25
- errorExit $?
26
- npm run docs &> $DEVNULL
27
- errorExit $?
28
-
29
- TARGET_BUCKET="gs://$bucket_name/$library/$version"
30
- BUCKET_COPY="gsutil -m cp -r $cwd/docs/** $TARGET_BUCKET"
31
-
32
- cat<<LOG_COPYING
33
-
34
- Copying docs to bucket => `color g "$BUCKET_COPY"`
35
-
36
- LOG_COPYING
37
-
38
- $(BUCKET_COPY)