@leverege/build-tools 2.50.17 → 2.51.0-beta.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.
- package/package.json +9 -8
- package/src/Utils.mjs +1 -3
- package/src/bash-funcs +1 -5
- package/src/circleate.sh +1 -0
- package/src/dockreate.sh +2 -2
- package/src/documentate.sh +38 -0
- package/src/git-tar.sh +3 -10
- package/src/helm-charts/api-server/values-local.yaml +0 -6
- package/src/helm-charts/authz-server/values-local.yaml +0 -5
- package/src/helm-charts/cnpg-db-psql-stack/cluster.yaml.ovh +8 -21
- package/src/helm-charts/cnpg-db-tsdb-basic/cluster.yaml.ovh +0 -3
- package/src/helm-charts/cnpg-db-tsdb-dense/cluster.yaml.ovh +0 -3
- package/src/helm-charts/grafana/grafana-local.yaml.ovh +2 -1
- package/src/helm-charts/grafana/helmup.plugin +1 -1
- package/src/helm-charts/redis/helmup.plugin +1 -1
- package/src/helm-charts/redis/redis-local.yaml +0 -10
- package/src/helm-charts/resource-server/values-local.yaml +1 -3
- package/src/helm-charts/rule-engine/values-local.yaml +1 -1
- package/src/helm-charts/traefik/helmup.plugin +1 -5
- package/src/helm-charts/velero/helmup.plugin +1 -1
- package/src/helmup.sh +1 -1
- package/src/k8scale.sh +2 -10
- package/src/overwhelm.mjs +5 -19
- package/registry-compass.yaml +0 -20
- package/src/chart-compass.mjs +0 -96
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.51.0-beta.1",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -20,6 +20,7 @@
|
|
|
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",
|
|
23
24
|
"docker-to-registry": "src/docker-to-registry.mjs",
|
|
24
25
|
"docker-to-registry.sh": "src/docker-to-registry.sh",
|
|
25
26
|
"encrypt-secrets": "src/encrypt-secrets.sh",
|
|
@@ -61,23 +62,23 @@
|
|
|
61
62
|
"command-line-usage": "^7.0.1",
|
|
62
63
|
"deepmerge": "^4.3.1",
|
|
63
64
|
"enquirer": "^2.4.1",
|
|
64
|
-
"execa": "^9.
|
|
65
|
-
"glob": "^10.
|
|
65
|
+
"execa": "^9.1.0",
|
|
66
|
+
"glob": "^10.3.16",
|
|
66
67
|
"handlebars": "^4.7.8",
|
|
67
|
-
"inquirer": "^9.
|
|
68
|
+
"inquirer": "^9.2.22",
|
|
68
69
|
"js-yaml": "^4.1.0",
|
|
69
70
|
"ms": "^2.1.3",
|
|
70
|
-
"npm-registry-fetch": "^17.1
|
|
71
|
+
"npm-registry-fetch": "^17.0.1",
|
|
71
72
|
"package-up": "^5.0.0",
|
|
72
73
|
"parse-gitignore": "^2.0.0",
|
|
73
74
|
"read-pkg": "^9.0.1",
|
|
74
75
|
"readline-sync": "^1.4.10",
|
|
75
76
|
"semver": "^7.6.2",
|
|
76
|
-
"simple-git": "^3.
|
|
77
|
-
"zx": "^8.1.
|
|
77
|
+
"simple-git": "^3.24.0",
|
|
78
|
+
"zx": "^8.1.1"
|
|
78
79
|
},
|
|
79
80
|
"devDependencies": {
|
|
80
81
|
"@leverege/eslint-config-leverege": "^4.2.0",
|
|
81
|
-
"npm": "^10.8.
|
|
82
|
+
"npm": "^10.8.0"
|
|
82
83
|
}
|
|
83
84
|
}
|
package/src/Utils.mjs
CHANGED
|
@@ -7,9 +7,7 @@ import { glob } from 'glob'
|
|
|
7
7
|
import { packageUp } from 'package-up'
|
|
8
8
|
import YAML from 'js-yaml'
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export const disableDebug = () => debugEnabled = false
|
|
10
|
+
const debugEnabled = process.env.BUILD_TOOLS_DEBUG === '1'
|
|
13
11
|
|
|
14
12
|
/* eslint-disable no-console */
|
|
15
13
|
export const err = console.error
|
package/src/bash-funcs
CHANGED
|
@@ -29,12 +29,8 @@ 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
|
-
|
|
36
32
|
function clearlyWarn() {
|
|
37
|
-
|
|
33
|
+
[ -z "$1" ] && clear
|
|
38
34
|
cat<<CLEARWARN
|
|
39
35
|
|
|
40
36
|
`color y '*** WARNING *** WARNING *** WARNING *** WARNING *** WARNING *** WARNING ***'`
|
package/src/circleate.sh
CHANGED
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:-
|
|
101
|
+
local nodeimg="${2:-hydrogen-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:-
|
|
239
|
+
nodeimg="${nodeimg:-hydrogen-alpine}"
|
|
240
240
|
apkadds=$(packageJson '.leverege.apkadds')
|
|
241
241
|
runuser=$(packageJson '.leverege.runuser')
|
|
242
242
|
[ -z "${runuser}" ] && runuser='node'
|
|
@@ -0,0 +1,38 @@
|
|
|
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 clean-docs &> $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 ./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)
|
package/src/git-tar.sh
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
-
# Load the standard helper functions
|
|
4
|
-
. `build-tools --bashfun`
|
|
5
|
-
|
|
6
3
|
# If it isn't already set use the default ~/work/.gitar
|
|
7
4
|
#
|
|
8
5
|
[ -z $GITAR ] && GITAR="${HOME}/.gitar"
|
|
@@ -68,13 +65,12 @@ REPO=`basename ${GTOP}`
|
|
|
68
65
|
#
|
|
69
66
|
DTS="`date +\"%Y%m%d-%H%M%S\"`"
|
|
70
67
|
|
|
71
|
-
|
|
72
|
-
TARB=${TARS}/${DTS}.tar # Craft the target tarball name.
|
|
68
|
+
TARB=${GITAR}/${REPO}/${DTS}.tar # Craft the target tarball name.
|
|
73
69
|
|
|
74
70
|
# Now do the work
|
|
75
71
|
#
|
|
76
72
|
cd ${GTOP}/..
|
|
77
|
-
printf "\n*** Tarring
|
|
73
|
+
printf "\n*** Tarring $TARB\n"
|
|
78
74
|
tar cf $TARB -X $TARX $REPO
|
|
79
75
|
chmod 0640 $TARB
|
|
80
76
|
|
|
@@ -88,9 +84,6 @@ then
|
|
|
88
84
|
FIZ=xz
|
|
89
85
|
fi
|
|
90
86
|
|
|
91
|
-
printf "
|
|
87
|
+
printf "*** Compressing $TARB.$FIZ (background)\n\n"
|
|
92
88
|
$ZIPPER $TARB &
|
|
93
|
-
|
|
94
|
-
printf "\n*** Tarballs in `color g ${TARS}`\n\n"
|
|
95
|
-
ls -lh ${TARS}
|
|
96
89
|
cd - 2>&1 >/dev/null
|
|
@@ -13,35 +13,24 @@ 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
|
-
|
|
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
|
|
21
18
|
- CREATE DATABASE authz;
|
|
22
19
|
- CREATE DATABASE fota;
|
|
23
20
|
- CREATE DATABASE geotile;
|
|
24
21
|
- CREATE DATABASE models;
|
|
25
22
|
- CREATE DATABASE scheduler;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
owner: imagine
|
|
24
|
+
secret:
|
|
25
|
+
name: cnpg-db-psql-stack-imagine-pw # imagine db pw
|
|
29
26
|
|
|
30
27
|
enableSuperuserAccess: true
|
|
31
28
|
superuserSecret:
|
|
32
29
|
name: cnpg-db-psql-stack-postgres-pw # postgres db pw
|
|
33
30
|
|
|
34
31
|
affinity:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
nodeAffinity:
|
|
38
|
-
requiredDuringSchedulingIgnoredDuringExecution:
|
|
39
|
-
nodeSelectorTerms:
|
|
40
|
-
- matchExpressions:
|
|
41
|
-
- key: target-env
|
|
42
|
-
operator: In
|
|
43
|
-
values:
|
|
44
|
-
- database
|
|
32
|
+
# enablePodAntiAffinity: true
|
|
33
|
+
# topologyKey: kubernetes.io/hostname # default value
|
|
45
34
|
tolerations:
|
|
46
35
|
- key: "database"
|
|
47
36
|
operator: "Equal"
|
|
@@ -94,7 +83,6 @@ spec:
|
|
|
94
83
|
cnpgCluster: cnpg-db-psql-stack
|
|
95
84
|
wal:
|
|
96
85
|
compression: gzip
|
|
97
|
-
maxParallel: 4
|
|
98
86
|
---
|
|
99
87
|
apiVersion: postgresql.cnpg.io/v1
|
|
100
88
|
kind: ScheduledBackup
|
|
@@ -103,9 +91,8 @@ metadata:
|
|
|
103
91
|
namespace: cnpg-operands
|
|
104
92
|
spec:
|
|
105
93
|
# https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format
|
|
106
|
-
schedule: "0 0
|
|
94
|
+
schedule: "0 0 * * * *"
|
|
107
95
|
cluster:
|
|
108
|
-
|
|
109
|
-
method: barmanObjectStore # volumeSnapshot
|
|
96
|
+
method: volumeSnapshot
|
|
110
97
|
backupOwnerReference: self
|
|
111
98
|
immediate: true
|
|
@@ -19,8 +19,6 @@ 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
|
|
24
22
|
database: imagine
|
|
25
23
|
owner: imagine
|
|
26
24
|
secret:
|
|
@@ -96,7 +94,6 @@ spec:
|
|
|
96
94
|
cnpgCluster: cnpg-db-tsdb-basic
|
|
97
95
|
wal:
|
|
98
96
|
compression: gzip
|
|
99
|
-
maxParallel: 4
|
|
100
97
|
---
|
|
101
98
|
apiVersion: postgresql.cnpg.io/v1
|
|
102
99
|
kind: ScheduledBackup
|
|
@@ -19,8 +19,6 @@ 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
|
|
24
22
|
database: imagine
|
|
25
23
|
owner: imagine
|
|
26
24
|
secret:
|
|
@@ -95,7 +93,6 @@ spec:
|
|
|
95
93
|
cnpgCluster: cnpg-db-tsdb-dense
|
|
96
94
|
wal:
|
|
97
95
|
compression: gzip
|
|
98
|
-
maxParallel: 4
|
|
99
96
|
---
|
|
100
97
|
apiVersion: postgresql.cnpg.io/v1
|
|
101
98
|
kind: ScheduledBackup
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# ONLY EDIT grafana-local.yaml.ovh / grafana-local.yaml is git ignored
|
|
2
2
|
service:
|
|
3
|
+
type: "NodePort"
|
|
3
4
|
port: "9000"
|
|
4
5
|
|
|
5
6
|
datasources:
|
|
@@ -38,7 +39,7 @@ tolerations:
|
|
|
38
39
|
effect: "NoSchedule"
|
|
39
40
|
|
|
40
41
|
extraObjects:
|
|
41
|
-
- apiVersion: traefik.
|
|
42
|
+
- apiVersion: traefik.containo.us/v1alpha1
|
|
42
43
|
kind: IngressRoute
|
|
43
44
|
metadata:
|
|
44
45
|
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
|
+
[ -z "$GRAFANA_CHART_VERSION" ] && GRAFANA_CHART_VERSION="7"
|
|
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.
|
|
7
|
+
[ -z "$REDIS_CHART_VERSION" ] && REDIS_CHART_VERSION="19.5.0"
|
|
8
8
|
|
|
9
9
|
helm upgrade --install redis $OCI_CHART \
|
|
10
10
|
--values redis/redis-local.yaml \
|
|
@@ -25,11 +25,6 @@ master:
|
|
|
25
25
|
persistence:
|
|
26
26
|
size: 8Gi # 8Gi is default
|
|
27
27
|
|
|
28
|
-
resources:
|
|
29
|
-
requests:
|
|
30
|
-
cpu: 250m
|
|
31
|
-
memory: 500Mi
|
|
32
|
-
|
|
33
28
|
replica:
|
|
34
29
|
affinity:
|
|
35
30
|
nodeAffinity:
|
|
@@ -50,11 +45,6 @@ replica:
|
|
|
50
45
|
persistence:
|
|
51
46
|
size: 8Gi # 8Gi is default
|
|
52
47
|
|
|
53
|
-
resources:
|
|
54
|
-
requests:
|
|
55
|
-
cpu: 250m
|
|
56
|
-
memory: 500Mi
|
|
57
|
-
|
|
58
48
|
architecture: replication
|
|
59
49
|
|
|
60
50
|
sentinel:
|
|
@@ -5,11 +5,7 @@
|
|
|
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
|
|
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
|
|
8
|
+
# ***DO NOT FORGET*** the -n traefik for kubectl commands
|
|
13
9
|
#
|
|
14
10
|
showInstalling "Traefik Load Balancer / Router"
|
|
15
11
|
|
|
@@ -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="
|
|
7
|
+
[ -z "$VELERO_CHART_VERSION" ] && VELERO_CHART_VERSION="6"
|
|
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
|
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="
|
|
669
|
+
[ -z "$VELERO_HELM_CHART" ] && VELERO_HELM_CHART="6"
|
|
670
670
|
|
|
671
671
|
## Create a bucket
|
|
672
672
|
BUCKET="$GCP_PROJECT_ID-velero-$VELERO_HELM_CHART"
|
package/src/k8scale.sh
CHANGED
|
@@ -19,11 +19,8 @@ case $DIRECTION in
|
|
|
19
19
|
REPLICAS=0
|
|
20
20
|
DIRECTION=down
|
|
21
21
|
;;
|
|
22
|
-
roll)
|
|
23
|
-
DIRECTION=roll
|
|
24
|
-
;;
|
|
25
22
|
*)
|
|
26
|
-
printf "Usage: `color g 'k8scale <up|dn|down
|
|
23
|
+
printf "Usage: `color g 'k8scale <up|dn|down> [deployment-list]'`\n\n" && exit 1
|
|
27
24
|
esac
|
|
28
25
|
|
|
29
26
|
printf " scaled => `color g $DIRECTION`\n\n"
|
|
@@ -31,12 +28,7 @@ for DEPLOYMENT in "$@";
|
|
|
31
28
|
do
|
|
32
29
|
IFS="/" read SERVICE <<< "$DEPLOYMENT" # strip trailing /
|
|
33
30
|
RESULTS="`color g SUCCESS`"
|
|
34
|
-
|
|
35
|
-
then
|
|
36
|
-
kubectl rollout restart deployment $SERVICE &> $DEVNULL
|
|
37
|
-
else
|
|
38
|
-
kubectl scale --replicas=$REPLICAS deployment $SERVICE &> $DEVNULL
|
|
39
|
-
fi
|
|
31
|
+
kubectl scale --replicas=$REPLICAS deployment $SERVICE &>/dev/null
|
|
40
32
|
[ $? -eq 1 ] && RESULTS="`color r FAILURE`"
|
|
41
33
|
printf " $RESULTS => $SERVICE\n"
|
|
42
34
|
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,
|
|
18
|
+
import { debug, err, log, shellCmd } from './Utils.mjs'
|
|
19
19
|
|
|
20
20
|
const optionsDefinitions = [
|
|
21
21
|
/* eslint-disable no-multi-spaces */
|
|
@@ -33,9 +33,6 @@ 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
|
-
|
|
39
36
|
// See if we are in a monorepo, which changes some of the rules.
|
|
40
37
|
const gitTop = await shellCmd( 'git rev-parse --show-toplevel' )
|
|
41
38
|
|
|
@@ -67,21 +64,10 @@ if ( !fs.existsSync( 'overwhelm.yaml' ) ) {
|
|
|
67
64
|
if ( fs.existsSync( 'values-default.yaml' ) ) {
|
|
68
65
|
log( chalk.red.bold( `
|
|
69
66
|
|
|
70
|
-
***ERROR overwhelm => values-default.yaml is no longer used/supported
|
|
71
|
-
|
|
67
|
+
***ERROR overwhelm => values-default.yaml is no longer used/supported
|
|
68
|
+
all defaults should be set in default-configs.yaml.ovh
|
|
72
69
|
` ) )
|
|
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
|
|
70
|
+
process.exit( 1 )
|
|
85
71
|
}
|
|
86
72
|
|
|
87
73
|
// Load the default values and then overlay with the project specific yaml
|
|
@@ -211,7 +197,7 @@ const doReplacements = ( yamls, replacements ) => {
|
|
|
211
197
|
|
|
212
198
|
// Collect all of the yaml from the yams...
|
|
213
199
|
const buildYaml = ( yamls, replacements ) => {
|
|
214
|
-
const always = [
|
|
200
|
+
const always = [ 'default-configs.yaml' ]
|
|
215
201
|
const values = [ ...always, ...yamls ]
|
|
216
202
|
const loaded = []
|
|
217
203
|
let allYamls = ''
|
package/registry-compass.yaml
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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/chart-compass.mjs
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
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' )
|