@leverege/build-tools 2.63.0 → 2.63.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.63.
|
|
3
|
+
"version": "2.63.2",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -60,7 +60,6 @@
|
|
|
60
60
|
"author": "Leverege Devs",
|
|
61
61
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@google-cloud/artifact-registry": "^3.5.0",
|
|
64
63
|
"@leverege/jsdoc-template": "^1.0.1",
|
|
65
64
|
"chalk": "^5.4.1",
|
|
66
65
|
"command-line-args": "^6.0.1",
|
package/src/build-cnpg-image.mjs
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
// A simple utility for easily building CNPG based psql images. The resultant
|
|
4
4
|
// image will contain PostgreSQL, the JS query and Timescale extensions, and
|
|
5
5
|
// the extensions that are required by CNPG like barman, pgaudit, pgvector and
|
|
6
|
-
// pg-failover-slots.
|
|
6
|
+
// pg-failover-slots. The docker image will be built using GCP Cloud Build in
|
|
7
|
+
// order to create an image that is k8s friendly.
|
|
7
8
|
//
|
|
8
9
|
// Latest Versions:
|
|
9
10
|
// postgres => https://www.postgresql.org/
|
|
@@ -11,6 +12,7 @@
|
|
|
11
12
|
// CNPG images => https://github.com/cloudnative-pg/postgres-containers/pkgs/container/postgresql
|
|
12
13
|
|
|
13
14
|
import fs from 'node:fs'
|
|
15
|
+
import os from 'node:os'
|
|
14
16
|
import path from 'node:path'
|
|
15
17
|
|
|
16
18
|
import chalk from 'chalk'
|
|
@@ -122,25 +124,22 @@ const buildAndPushImage = async () => {
|
|
|
122
124
|
const renderedDockerfile = template( { PG_VERSION } )
|
|
123
125
|
debug( { renderedDockerfile }, '<==Dockerfile' )
|
|
124
126
|
|
|
125
|
-
//
|
|
126
|
-
const buildDir = '
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
// Clean up the temporary Dockerfile
|
|
143
|
-
fs.rmdirSync( buildDir, { recursive : true } )
|
|
127
|
+
// Create a temporary directory to build from
|
|
128
|
+
const buildDir = fs.mkdtempSync( path.join( os.tmpdir(), 'docker-build-' ) )
|
|
129
|
+
const dockerfilePath = path.join( buildDir, 'Dockerfile' )
|
|
130
|
+
|
|
131
|
+
try {
|
|
132
|
+
fs.writeFileSync( dockerfilePath, renderedDockerfile )
|
|
133
|
+
|
|
134
|
+
log( chalk.yellow( '\nBuilding Docker image...' ) )
|
|
135
|
+
const cloudBuildSubmit = 'gcloud builds submit --project leverege-registry'
|
|
136
|
+
const cloudBuildLog = '--gcs-log-dir gs://leverege-registry_cloudbuild/log'
|
|
137
|
+
const imageTag = `--tag ${LEVEREGE_IMAGE_NAME_WITH_TAG}`
|
|
138
|
+
await shellCmd( `${cloudBuildSubmit} ${cloudBuildLog} ${imageTag} ${buildDir}`, { stdio : 'inherit' } )
|
|
139
|
+
} finally {
|
|
140
|
+
// Ensure cleanup even if the build fails
|
|
141
|
+
fs.rmSync( buildDir, { recursive : true, force : true } )
|
|
142
|
+
}
|
|
144
143
|
}
|
|
145
144
|
|
|
146
145
|
// Main execution flow
|
package/src/chart-compass.mjs
CHANGED
|
@@ -100,7 +100,7 @@ if ( args.init ) {
|
|
|
100
100
|
errorExit( `\n***ERROR: ${args.compass} compass file already exists - not overwriting` )
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
await shellCmd( `cp ${BUILD_TOOLS_ROOT}/chart-compass.yaml ${args.compass}` )
|
|
104
104
|
log( '\nBootstrapped a new chart compass defition => ', chalk.green.bold( args.compass ) )
|
|
105
105
|
process.exit( 0 )
|
|
106
106
|
}
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
showInstalling "Valkey"
|
|
4
|
+
|
|
5
|
+
OCI_CHART="oci://registry-1.docker.io/bitnamicharts/valkey"
|
|
6
|
+
|
|
7
|
+
[ -z "$VALKEY_CHART_VERSION" ] && VALKEY_CHART_VERSION="2.2.4"
|
|
8
|
+
|
|
9
|
+
helm upgrade --install valkey $OCI_CHART \
|
|
10
|
+
--values valkey/valkey-local.yaml \
|
|
11
|
+
--version $VALKEY_CHART_VERSION $HELM_WHAT
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
|
|
2
|
+
global:
|
|
3
|
+
storageClass: "ssd"
|
|
4
|
+
|
|
5
|
+
architecture: replication
|
|
6
|
+
|
|
7
|
+
auth:
|
|
8
|
+
enabled: false
|
|
9
|
+
sentinel: true
|
|
10
|
+
|
|
11
|
+
primary:
|
|
12
|
+
replicaCount: 1
|
|
13
|
+
|
|
14
|
+
resourcesPreset: "nano"
|
|
15
|
+
resources:
|
|
16
|
+
requests:
|
|
17
|
+
cpu: 250m
|
|
18
|
+
memory: 500Mi
|
|
19
|
+
|
|
20
|
+
updateStrategy:
|
|
21
|
+
## StrategyType
|
|
22
|
+
## Can be set to RollingUpdate, OnDelete (statefulset), Recreate (deployment)
|
|
23
|
+
##
|
|
24
|
+
type: RollingUpdate
|
|
25
|
+
|
|
26
|
+
affinity:
|
|
27
|
+
nodeAffinity:
|
|
28
|
+
requiredDuringSchedulingIgnoredDuringExecution:
|
|
29
|
+
nodeSelectorTerms:
|
|
30
|
+
- matchExpressions:
|
|
31
|
+
- key: target-env
|
|
32
|
+
operator: In
|
|
33
|
+
values:
|
|
34
|
+
- database
|
|
35
|
+
|
|
36
|
+
tolerations:
|
|
37
|
+
- key: "database"
|
|
38
|
+
operator: "Equal"
|
|
39
|
+
value: "true"
|
|
40
|
+
effect: "NoSchedule"
|
|
41
|
+
|
|
42
|
+
persistence:
|
|
43
|
+
enabled: true
|
|
44
|
+
size: 8Gi
|
|
45
|
+
|
|
46
|
+
replica:
|
|
47
|
+
replicaCount: 1
|
|
48
|
+
|
|
49
|
+
resourcesPreset: "nano"
|
|
50
|
+
resources:
|
|
51
|
+
requests:
|
|
52
|
+
cpu: 250m
|
|
53
|
+
memory: 500Mi
|
|
54
|
+
|
|
55
|
+
affinity:
|
|
56
|
+
nodeAffinity:
|
|
57
|
+
requiredDuringSchedulingIgnoredDuringExecution:
|
|
58
|
+
nodeSelectorTerms:
|
|
59
|
+
- matchExpressions:
|
|
60
|
+
- key: target-env
|
|
61
|
+
operator: In
|
|
62
|
+
values:
|
|
63
|
+
- database
|
|
64
|
+
|
|
65
|
+
tolerations:
|
|
66
|
+
- key: "database"
|
|
67
|
+
operator: "Equal"
|
|
68
|
+
value: "true"
|
|
69
|
+
effect: "NoSchedule"
|
|
70
|
+
|
|
71
|
+
persistence:
|
|
72
|
+
enabled: true
|
|
73
|
+
size: 8Gi
|
|
74
|
+
|
|
75
|
+
sentinel:
|
|
76
|
+
enabled: false
|
|
77
|
+
|
|
78
|
+
metrics:
|
|
79
|
+
enabled: true
|
|
80
|
+
serviceMonitor:
|
|
81
|
+
enabled: true
|
|
82
|
+
namespace: "prometheus"
|
|
83
|
+
relabelings:
|
|
84
|
+
- action: labelmap
|
|
85
|
+
regex: __meta_kubernetes_pod_label_(.+)
|
|
86
|
+
- action: labelmap
|
|
87
|
+
regex: __meta_kubernetes_service_label_(.+)
|