@leverege/build-tools 2.5.43 → 2.5.45
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/lib/server/repo-init/config.tgz +0 -0
- package/package.json +2 -3
- package/src/dockreate +4 -1
- package/src/k8cycle +0 -44
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leverege/build-tools",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.45",
|
|
4
4
|
"description": "A collection of build / support tools for Leverege developers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -63,7 +63,6 @@
|
|
|
63
63
|
"glob": "^7.1.7",
|
|
64
64
|
"inquirer": "^8.1.2",
|
|
65
65
|
"js-yaml": "^4.1.0",
|
|
66
|
-
"kubernetes-client": "^9.0.0",
|
|
67
66
|
"ncp": "^2.0.0",
|
|
68
67
|
"npm-check-updates": "^11.8.3",
|
|
69
68
|
"npm-registry-fetch": "^11.0.0",
|
|
@@ -80,6 +79,6 @@
|
|
|
80
79
|
"@babel/node": "^7.14.7",
|
|
81
80
|
"@leverege/babel-preset-leverege-node": "^1.2.0",
|
|
82
81
|
"@leverege/eslint-config-leverege": "^3.0.0",
|
|
83
|
-
"npm": "^7.
|
|
82
|
+
"npm": "^7.20.0"
|
|
84
83
|
}
|
|
85
84
|
}
|
package/src/dockreate
CHANGED
|
@@ -58,6 +58,7 @@ create_Dockerfile() {
|
|
|
58
58
|
#
|
|
59
59
|
# The FROM directive sets the Base Image for subsequent instructions
|
|
60
60
|
FROM node:${nodeimg} as intermediate
|
|
61
|
+
ENV NODE_ENV production
|
|
61
62
|
|
|
62
63
|
RUN mkdir -p /usr/src/app
|
|
63
64
|
WORKDIR /usr/src/app
|
|
@@ -102,7 +103,7 @@ DOCKERBLD
|
|
|
102
103
|
ENTRYPOINT [ "/sbin/tini", "--" ]
|
|
103
104
|
WORKDIR /usr/src/app
|
|
104
105
|
|
|
105
|
-
COPY --from=intermediate /usr/src/app /usr/src/app
|
|
106
|
+
COPY --chown=node:node --from=intermediate /usr/src/app /usr/src/app
|
|
106
107
|
|
|
107
108
|
USER ${runuser}
|
|
108
109
|
COPY ./bashrc /home/node/.bashrc
|
|
@@ -194,6 +195,8 @@ apkadds=$(strip_undefined "`node -p \"require('../package.json').leverege.apkadd
|
|
|
194
195
|
runuser=$(strip_undefined "`node -p \"require('../package.json').leverege.runuser\"`")
|
|
195
196
|
[ -z "${runuser}" ] && runuser='node'
|
|
196
197
|
|
|
198
|
+
echo "Updating dependencies and workspace..." && npm install
|
|
199
|
+
|
|
197
200
|
container="`node -p \"require('../package.json').leverege.container\"`"
|
|
198
201
|
if [ "$container" == "undefined" ];
|
|
199
202
|
then
|
package/src/k8cycle
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
const { Client } = require( 'kubernetes-client' )
|
|
3
|
-
const client = new Client( { version : '1.13' } )
|
|
4
|
-
|
|
5
|
-
const condir = ( log, thing ) => {
|
|
6
|
-
console.dir( { log, thing }, { depth : 8, colors : true } ) // eslint-disable-line
|
|
7
|
-
}
|
|
8
|
-
const getSecrets = async () => {
|
|
9
|
-
const p = await client.api.v1.secrets.get()
|
|
10
|
-
const secrets = []
|
|
11
|
-
p.body.items.forEach( ( item ) => {
|
|
12
|
-
console.log( item.metadata.name )
|
|
13
|
-
secrets.push( item.metadata.name, item.data )
|
|
14
|
-
} )
|
|
15
|
-
return secrets
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const getSecret = async ( name, ns = 'default' ) => {
|
|
19
|
-
//const p = await client.api.v1.namespaces.default.secrets.big-query.get()
|
|
20
|
-
const p = await client.api.v1.namespaces(ns).secrets(name).get()
|
|
21
|
-
console.dir( p, { depth : 8, colors : true } )
|
|
22
|
-
//console.log( p.body.data, '<=SRSLY?' )
|
|
23
|
-
let buff = Buffer.from( p.body.data.key, 'base64' )
|
|
24
|
-
console.log( `Name=>${name} Secret=>'${buff.toString( 'ascii' ).trim()}'` )
|
|
25
|
-
}
|
|
26
|
-
const getReplicas = async ( type, ns = 'default' ) => {
|
|
27
|
-
const replicas = await client.apis.apps.v1.namespaces( ns )[type].get()
|
|
28
|
-
return replicas.body.items.map( ( item, idx ) => {
|
|
29
|
-
return { type, ns, name : item.metadata.name }
|
|
30
|
-
} )
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const getDeploymentsAndStatefulsets = async ( name, ns = 'default' ) => {
|
|
34
|
-
return [
|
|
35
|
-
...await getReplicas( 'deployments' ),
|
|
36
|
-
...await getReplicas( 'statefulsets' ),
|
|
37
|
-
]
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
let depsets
|
|
41
|
-
async function main () {
|
|
42
|
-
console.log( '--- NOT READY FOR PRIME TIME ---' )
|
|
43
|
-
depsets = await getDeploymentsAndStatefulsets()
|
|
44
|
-
}
|