cob-cli 2.38.2 → 2.39.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/bin/cob-cli.js
CHANGED
|
@@ -11,6 +11,7 @@ const customize = require("../lib/commands/customize");
|
|
|
11
11
|
const test = require("../lib/commands/test");
|
|
12
12
|
const deploy = require("../lib/commands/deploy");
|
|
13
13
|
const updateFromServer = require("../lib/commands/updateFromServer");
|
|
14
|
+
const getDefs = require("../lib/commands/getDefs");
|
|
14
15
|
const { upgradeRepo } = require("../lib/commands/upgradeRepo");
|
|
15
16
|
|
|
16
17
|
/*******************************************/
|
|
@@ -78,4 +79,10 @@ program
|
|
|
78
79
|
.description('Upgrade current repository to the last cob-cli version structure')
|
|
79
80
|
.action( upgradeRepo );
|
|
80
81
|
|
|
82
|
+
program
|
|
83
|
+
.command('getDefs')
|
|
84
|
+
.option('-e --environment <name>', 'environment to use')
|
|
85
|
+
.description('Updates local copy with definitions on server')
|
|
86
|
+
.action( getDefs );
|
|
87
|
+
|
|
81
88
|
program.parse(process.argv);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require('colors');
|
|
2
|
+
const { getCurrentCommandEnviroment } = require("../task_lists/common_enviromentHandler");
|
|
3
|
+
const { checkRepoVersion } = require("../commands/upgradeRepo");
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const spawn = require('child_process').spawn;
|
|
6
|
+
|
|
7
|
+
async function getDefs(args) {
|
|
8
|
+
try {
|
|
9
|
+
checkRepoVersion()
|
|
10
|
+
const cmdEnv = await getCurrentCommandEnviroment(args)
|
|
11
|
+
|
|
12
|
+
console.log(`Getting definitions from ${cmdEnv.serverStr} to branch ${cmdEnv.branchStr} ...` );
|
|
13
|
+
const getDefs = spawn(path.resolve(__dirname,"..","task_lists","getDefs.sh"),[cmdEnv.server, cmdEnv.name, path.resolve(__dirname) ])
|
|
14
|
+
getDefs.stdout.on('data', function (data) { console.log(" " + data.toString()); });
|
|
15
|
+
getDefs.on('exit', function () { console.log('Done!'); });
|
|
16
|
+
} catch(err) {
|
|
17
|
+
console.error("\n",err.message);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
module.exports = getDefs;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
IFS=$'\n'
|
|
2
|
+
SERVER=${1}
|
|
3
|
+
ENVIRONMENT=${2}
|
|
4
|
+
COBCLIPATH=${3}
|
|
5
|
+
|
|
6
|
+
echo "mkdir -p recordm/definitions/\\c"
|
|
7
|
+
mkdir -p recordm/definitions/
|
|
8
|
+
|
|
9
|
+
echo "rm -f recordm/definitions/$ENVIRONMENT\\c"
|
|
10
|
+
rm -f recordm/definitions/$ENVIRONMENT/*
|
|
11
|
+
|
|
12
|
+
DIR=recordm/definitions/$ENVIRONMENT
|
|
13
|
+
echo "mkdir -p $DIR"
|
|
14
|
+
mkdir -p $DIR
|
|
15
|
+
|
|
16
|
+
for def in $(ssh $SERVER "curl -sS -b ~/.cob-cookie http://localhost:40280/recordm/definitions" | jq .[] -c | node $COBCLIPATH/../../node_modules/cmd-line-importer/processor.js --transformer "JSON.stringify([entry.id,entry.name])"); do
|
|
17
|
+
echo " getting def: $def ...\\c"
|
|
18
|
+
ssh $SERVER "curl -sS -b ~/.cob-cookie http://localhost:40280/recordm/definitions/$(echo $def | jq '.[0]')" | jq --sort-keys . | grep -v "\"defaultValue\":" > $DIR/$(echo $def | jq .[1] | tr -d '"').json
|
|
19
|
+
done
|
|
@@ -64,7 +64,6 @@ async function otherFilesContiousReload(cmdEnv) {
|
|
|
64
64
|
ignoreInitial: true
|
|
65
65
|
});
|
|
66
66
|
watcher.process.on('all', async (eventType, changedFile) => {
|
|
67
|
-
console.log(eventType, changedFile);
|
|
68
67
|
// Não é preciso fazer nada para directorias que só existem no servidor
|
|
69
68
|
let product = changedFile.split("/")[0];
|
|
70
69
|
let productDir = resolveCobPath(cmdEnv.server, "serverLive", product).split(":")[1];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cob-cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.39.0",
|
|
4
4
|
"description": "A command line utility to help Cult of Bits partners develop with higher speed and reusing common code and best practices.",
|
|
5
5
|
"preferGlobal": true,
|
|
6
6
|
"repository": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@webpack-cli/serve": "^2.0.1",
|
|
20
20
|
"axios": "^0.21.1",
|
|
21
|
+
"cmd-line-importer": "^1.0.0",
|
|
21
22
|
"colors": "^1.4.0",
|
|
22
23
|
"commander": "^5.1.0",
|
|
23
24
|
"concurrently": "^5.3.0",
|