@leverege/build-tools 2.20.0 → 2.21.0-beta.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.
@@ -8,6 +8,7 @@ const fs = require('fs');
8
8
  const untarConfigTarball = async (subdir, tarball) => {
9
9
  if (fs.existsSync(subdir)) {
10
10
  process.chdir(subdir);
11
+ await execa('ls');
11
12
  await execa('tar', ['xf', tarball]);
12
13
  }
13
14
  };
@@ -162,15 +162,16 @@ const start = async () => {
162
162
  await gitter.build(buildSpec);
163
163
  console.log(chalk.green.bold`
164
164
  Repository setup complete.
165
-
166
- Still to work out:`, chalk.yellow`
167
- - figure out better approach for partial file read on transform
168
- - add / flesh out remaining templates
169
- - express-server
170
- - library
171
- - ui-lib
172
- - ui-???
173
- `);
165
+ ` // chalk.green.bold`Still to work out:`,
166
+ // chalk.yellow`
167
+ // - figure out better approach for partial file read on transform
168
+ // - add / flesh out remaining templates
169
+ // - express-server
170
+ // - library
171
+ // - ui-lib
172
+ // - ui-???
173
+ // `
174
+ );
174
175
  };
175
176
 
176
177
  exports.start = start;
Binary file
@@ -74,15 +74,16 @@ class Gitter {
74
74
  name: 'git.host',
75
75
  message: 'Where will the repository be hosted?',
76
76
  choices: ['bitbucket', 'github', 'local']
77
- }, {
78
- type: 'list',
79
- name: 'git.owner',
80
- message: 'Who is the owner of the git repository?',
81
- choices: ['leverege', 'cox2m'],
82
- when: answer => {
83
- return answer.git.host !== 'local';
84
- }
85
- }, {
77
+ }, // {
78
+ // type : 'input',
79
+ // name : 'git.owner',
80
+ // message : 'Who is the owner of the git repository?',
81
+ // default : 'leverege',
82
+ // when : ( answer ) => {
83
+ // return answer.git.host !== 'local'
84
+ // },
85
+ // },
86
+ {
86
87
  type: 'list',
87
88
  name: 'git.createRemote',
88
89
  message: 'Let repo-init create the remote git repository?',
@@ -127,21 +128,16 @@ class Gitter {
127
128
  const spinner = new Ora();
128
129
 
129
130
  if (buildSpec.config.npmCheck) {
130
- console.log(chalk.keyword('orange').bold(`
131
- Running npm-check-updates interactively to verify all of the package
132
- versions in package.json are up to date prior to committing everything.`), chalk.yellow.bold(`
133
-
134
- Pay attention! You may be asked to answer Y/n if any are out of date!`));
135
- spinner.start('Preparing for dependency checks prior to install.');
136
- await pause(3000);
137
- spinner.succeed();
138
- await execa('npm', ['install', 'npm-check-updates'], {
139
- stdio: 'inherit'
140
- });
141
- await execa('npm', ['run', 'npm-check-updates'], {
142
- stdio: 'inherit'
143
- }); // setup husky
144
-
131
+ // console.log( chalk.keyword( 'orange' ).bold( `
132
+ // Running npm-check-updates interactively to verify all of the package
133
+ // versions in package.json are up to date prior to committing everything.` ),
134
+ // chalk.yellow.bold( `
135
+ // Pay attention! You may be asked to answer Y/n if any are out of date!` )
136
+ // )
137
+ // spinner.start( 'Preparing for dependency checks prior to install.' )
138
+ // await pause( 3000 )
139
+ // spinner.succeed()
140
+ // setup husky
145
141
  await execa('npm', ['install', 'husky', '--save-dev'], {
146
142
  stdio: 'inherit'
147
143
  });
@@ -53,7 +53,11 @@ class Templates {
53
53
  }
54
54
 
55
55
  needsAnIngestionPort(template) {
56
- return template.type === 'ingestor' && template.subType !== 'PubSub';
56
+ return template.type === 'ingestor' && template.subType !== 'PubSub' && template.subType !== 'HTTP' && template.subType !== 'MQTT';
57
+ }
58
+
59
+ isMqtt(template) {
60
+ return template.type === 'ingestor' && template.subType === 'MQTT';
57
61
  }
58
62
 
59
63
  async runInquiry(spec) {
@@ -87,6 +91,22 @@ class Templates {
87
91
  when: answers => {
88
92
  return this.needsAnIngestionPort(answers.template);
89
93
  }
94
+ }, {
95
+ type: 'string',
96
+ name: 'template.mqttHost',
97
+ message: 'Enter the MQTT Broker address to use',
98
+ default: 'mqtt://broker.emqx.io',
99
+ when: answers => {
100
+ return this.isMqtt(answers.template);
101
+ }
102
+ }, {
103
+ type: 'number',
104
+ name: 'template.mqttPort',
105
+ message: 'Enter the MQTT Broker port to use',
106
+ default: 1883,
107
+ when: answers => {
108
+ return this.isMqtt(answers.template);
109
+ }
90
110
  }, {
91
111
  type: 'number',
92
112
  name: 'template.expressPort',
@@ -112,16 +132,17 @@ class Templates {
112
132
  },
113
133
  },
114
134
  */
135
+ // {
136
+ // type : 'confirm',
137
+ // name : 'template.helmify',
138
+ // message : 'Run helmify to generate Helm Charts?',
139
+ // default : false,
140
+ // when : ( answers ) => {
141
+ // const template = this.lookupTemplateByType( answers.template.type )
142
+ // return typeof template.helm !== 'undefined'
143
+ // },
144
+ // },
115
145
  {
116
- type: 'confirm',
117
- name: 'template.helmify',
118
- message: 'Run helmify to generate Helm Charts?',
119
- default: true,
120
- when: answers => {
121
- const template = this.lookupTemplateByType(answers.template.type);
122
- return typeof template.helm !== 'undefined';
123
- }
124
- }, {
125
146
  type: 'list',
126
147
  name: 'dotenv.logConfig',
127
148
  message: 'Your preferred logging method (.env)?',
@@ -8,6 +8,7 @@ const fs = require('fs');
8
8
  const untarConfigTarball = async (subdir, tarball) => {
9
9
  if (fs.existsSync(subdir)) {
10
10
  process.chdir(subdir);
11
+ await execa('ls');
11
12
  await execa('tar', ['xf', tarball]);
12
13
  }
13
14
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.20.0",
3
+ "version": "2.21.0-beta.2",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -64,7 +64,7 @@
64
64
  "inquirer": "^8.2.4",
65
65
  "js-yaml": "^4.1.0",
66
66
  "ncp": "^2.0.0",
67
- "npm-registry-fetch": "^13.3.1",
67
+ "npm-registry-fetch": "^13.3.0",
68
68
  "open": "^8.4.0",
69
69
  "ora": "^5.4.1",
70
70
  "parse-gitignore": "^2.0.0",
@@ -79,6 +79,6 @@
79
79
  "@babel/node": "^7.18.10",
80
80
  "@leverege/babel-preset-leverege-node": "^2.0.0",
81
81
  "@leverege/eslint-config-leverege": "^3.0.1",
82
- "npm": "^8.18.0"
82
+ "npm": "^8.17.0"
83
83
  }
84
84
  }
package/src/helmup CHANGED
@@ -1,3 +1,7 @@
1
+ #!/bin/bash
2
+ #
3
+ # This script is used to ease the pain of transition testing to chart museum
4
+ # for adding / updating deployments on a fluster.
1
5
  #
2
6
  # printf "\n***** RUNNING LOCALLY *****\n" && sleep 2
3
7
 
@@ -157,18 +161,32 @@ function installGrafana() {
157
161
  function installRedis() {
158
162
  showInstalling "Redis Network Cache"
159
163
  addBitnamiRepo latest
160
- [ -z "$REDIS_HELM_CHART" ] && REDIS_HELM_CHART="17" # latest chart 17 is redis v7
164
+ [ -z "$REDIS_HELM_CHART" ] && REDIS_HELM_CHART="16" # latest breaks us => "v14+"
161
165
  helm upgrade --install redis bitnami/redis \
162
166
  --version $REDIS_HELM_CHART \
163
167
  -f - <<REDIS_CHART_MODS
168
+ auth:
169
+ enabled: false
170
+
164
171
  global:
165
172
  storageClass: ssd
166
173
 
167
- auth:
168
- enabled: false
169
- sentinel: false
174
+ metrics:
175
+ enabled: true
176
+
177
+ networkPolicy:
178
+ enabled: true
170
179
 
171
180
  master:
181
+ persistence:
182
+ size: 8Gi # 8Gi is default
183
+
184
+ tolerations:
185
+ - key: "database"
186
+ operator: "Equal"
187
+ value: "true"
188
+ effect: "NoSchedule"
189
+
172
190
  affinity:
173
191
  nodeAffinity:
174
192
  requiredDuringSchedulingIgnoredDuringExecution:
@@ -179,29 +197,25 @@ master:
179
197
  values:
180
198
  - database
181
199
 
200
+ replica:
201
+ persistence:
202
+ size: 8Gi # 8Gi is default
203
+
182
204
  tolerations:
183
205
  - key: "database"
184
206
  operator: "Equal"
185
207
  value: "true"
186
208
  effect: "NoSchedule"
187
209
 
188
- persistence:
189
- size: 8Gi # 8Gi is default
190
-
191
- sentinel:
192
- enabled: true
193
-
194
- networkPolicy:
195
- enabled: true
196
- allowExternal: false
197
- ingressNSMatchLabels:
198
- redis: external
199
- ingressNSPodMatchLabels:
200
- redis-client: true
201
-
202
- metrics:
203
- enabled: true
204
-
210
+ affinity:
211
+ nodeAffinity:
212
+ requiredDuringSchedulingIgnoredDuringExecution:
213
+ nodeSelectorTerms:
214
+ - matchExpressions:
215
+ - key: target-env
216
+ operator: In
217
+ values:
218
+ - database
205
219
  REDIS_CHART_MODS
206
220
  if [[ $? -ne 0 ]];
207
221
  then
@@ -6,11 +6,12 @@ const fs = require( 'fs' )
6
6
  const untarConfigTarball = async ( subdir, tarball ) => {
7
7
  if ( fs.existsSync( subdir ) ) {
8
8
  process.chdir( subdir )
9
+ await execa( 'ls' )
9
10
  await execa( 'tar', [ 'xf', tarball ] )
10
11
  }
11
12
  }
12
13
 
13
- const awaiter = async ( subdir, tarball) => {
14
+ const awaiter = async ( subdir, tarball ) => {
14
15
  await untarConfigTarball( subdir, tarball )
15
16
  }
16
17