cob-cli 2.43.0 → 2.43.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/lib/task_lists/common_releaseManager.js +4 -4
- package/lib/task_lists/common_syncFiles.js +4 -2
- package/lib/task_lists/deploy_validate.js +1 -1
- package/package.json +1 -1
- package/.tap/processinfo/0db03a1d-f054-4ba8-9873-7efb81723721.json +0 -32
- package/.tap/processinfo/9d97e24f-ae90-4c49-af20-075bbcc46260.json +0 -38
- package/.tap/repl_history +0 -2
- package/.tap/test-results/lib/commands/test.js.tap +0 -0
- package/.tap/test-results/lib/task_lists/common_enviromentHandler.js.tap +0 -0
- package/.tap/test-results/lib/task_lists/common_helpers.js.tap +0 -0
- package/.tap/test-results/lib/task_lists/common_releaseManager.js.tap +0 -0
- package/.tap/test-results/lib/task_lists/common_syncFiles.js.tap +0 -0
- package/.tap/test-results/lib/task_lists/deploy_execute.js.tap +0 -0
- package/.tap/test-results/lib/task_lists/deploy_validate.js.tap +0 -0
- package/.tap/test-results/lib/task_lists/init_newProject.js.tap +0 -0
- package/.tap/test-results/lib/task_lists/test_customUIsContinuosReload.js.tap +0 -0
- package/.tap/test-results/lib/task_lists/test_otherFilesContiousReload.js.tap +0 -0
- package/.tap/test-results/lib/task_lists/test_syncFile.js.tap +0 -0
- package/.tap/test-results/lib/task_lists/test_validate.js.tap +0 -0
- package/.tap/test-results/lib/task_lists/updateFromServer_validate.js.tap +0 -0
- package/.tap/test-results/lib/webpack/fake_customizations2.js.tap +0 -1
- package/.tap/test-results/lib/webpack/webpack.config.js.tap +0 -0
- package/.tap/test-results/test/test_common_environmentHandler.js.tap +0 -40
|
@@ -49,10 +49,10 @@ async function registerRelease(cmdEnv) {
|
|
|
49
49
|
if (diffs) {
|
|
50
50
|
// Add deploy tags to repo
|
|
51
51
|
git().fetch(["--tags","-f"]) // Apenas para ter certeza que temos todas as tags
|
|
52
|
-
try {
|
|
52
|
+
try {
|
|
53
53
|
await git().silent(true).tag([deploySignature, "-d"])
|
|
54
54
|
} catch {}
|
|
55
|
-
|
|
55
|
+
|
|
56
56
|
await git().addAnnotatedTag(deploySignature, newDeployText )
|
|
57
57
|
await git().push(["-f", "origin", deploySignature])
|
|
58
58
|
git().fetch(["--tags","-f"]) // Apenas para ter certeza que temos todas as tags
|
|
@@ -66,9 +66,9 @@ async function getLastDeployedSha(server) {
|
|
|
66
66
|
let result
|
|
67
67
|
try {
|
|
68
68
|
result = await execa('ssh', [server, "cat " + SERVER_LAST_SHA_FILE ]);
|
|
69
|
-
} catch (error) {
|
|
69
|
+
} catch (error) {
|
|
70
70
|
await execa('ssh', [server, "mkdir -p " + SERVER_COB_CLI_DIRECTORY ]);
|
|
71
|
-
await execa('ssh', [server, "setfacl -d -m group:users:rw " + SERVER_COB_CLI_DIRECTORY ]);
|
|
71
|
+
// await execa('ssh', [server, "setfacl -d -m group:users:rw " + SERVER_COB_CLI_DIRECTORY ]);
|
|
72
72
|
return null
|
|
73
73
|
}
|
|
74
74
|
return result.stdout;
|
|
@@ -26,6 +26,8 @@ exports.testEquality = testEquality;
|
|
|
26
26
|
async function _syncFiles(executionType, cmdEnv, from, to, extraOptions = [], args = []) {
|
|
27
27
|
let changes = [];
|
|
28
28
|
let products = cmdEnv.products.length ? cmdEnv.products : COB_PRODUCTS;
|
|
29
|
+
// we need to recheck, because it can exist in head but not in the commit we're testing
|
|
30
|
+
let hasRsyncFilter = cmdEnv.rsyncFilter && fs.lstatSync(cmdEnv.rsyncFilter, {throwIfNoEntry: false})?.isFile();
|
|
29
31
|
let requests = products.map(product => {
|
|
30
32
|
return new Promise(async (resolve, reject) => {
|
|
31
33
|
let fromPath = resolveCobPath(cmdEnv.server, from, product);
|
|
@@ -52,7 +54,7 @@ async function _syncFiles(executionType, cmdEnv, from, to, extraOptions = [], ar
|
|
|
52
54
|
"--chmod=g+w",
|
|
53
55
|
"--perms",
|
|
54
56
|
"--filter='merge " + path.resolve(__dirname,"rsyncFilter-pre.txt") + "'",
|
|
55
|
-
|
|
57
|
+
hasRsyncFilter ? "--filter='merge " + cmdEnv.rsyncFilter + "'" : "",
|
|
56
58
|
"--filter='merge " + path.resolve(__dirname,"rsyncFilter-post.txt") + "'",
|
|
57
59
|
executionType == _syncFiles.COPY ? "-v" : "--dry-run"
|
|
58
60
|
].concat(productExtraOptions),
|
|
@@ -101,7 +103,7 @@ async function _syncFiles(executionType, cmdEnv, from, to, extraOptions = [], ar
|
|
|
101
103
|
reject(new Error(err));;
|
|
102
104
|
} else {
|
|
103
105
|
if (args.verbose > 1)
|
|
104
|
-
console.log("warning".yellow + "rsync '" + (product).blue + "': attempt " + (count + 1) + " failed with code " + err.exitCode);
|
|
106
|
+
console.log("warning".yellow + " rsync '" + (product).blue + "': attempt " + (count + 1) + " failed with code " + err.exitCode);
|
|
105
107
|
}
|
|
106
108
|
});
|
|
107
109
|
count++;
|
|
@@ -18,7 +18,7 @@ function validateDeployConditions(cmdEnv, args) {
|
|
|
18
18
|
{ title: "find out SHA for last-deploy on specified server", skip: () => args.force, task: (ctx) => getLastDeployedSha(cmdEnv.server).then(lastSha => _handleGetLastDeployedSha(ctx, cmdEnv, lastSha)) },
|
|
19
19
|
{ title: "git checkout SHA-for-last-deploy", skip: ctx => args.force || !ctx.lastSha, task: (ctx) => git().checkout(ctx.lastSha) },
|
|
20
20
|
{ title: "Apply last enviroment specifics".bold, skip: ctx => args.force || !ctx.lastSha, task: () => cmdEnv.applyLastEnvironmentDeployedToServerChanges() },
|
|
21
|
-
{ title: "Check last-deploy == serverLive".bold, skip: ctx => args.force || !ctx.lastSha, task: (ctx) => testEquality(cmdEnv, "localCopy", "serverLive").then( changes => _handleTestEquality(ctx, changes)) },
|
|
21
|
+
{ title: "Check last-deploy == serverLive".bold, skip: ctx => args.force || !ctx.lastSha, task: (ctx) => testEquality(cmdEnv, "localCopy", "serverLive", args).then( changes => _handleTestEquality(ctx, changes)) },
|
|
22
22
|
{ title: "Undo last enviroment specifics".bold, skip: ctx => args.force || !ctx.lastSha, task: () => cmdEnv.unApplyLastEnvironmentDeployedToServerChanges() },
|
|
23
23
|
{ title: "git checkout branch-for-HEAD", skip: ctx => args.force || !ctx.lastSha, task: (ctx) => git().checkout(ctx.currentBranch) },
|
|
24
24
|
{ title: "report problems", enabled: ctx => ctx.err, task: (ctx) => {throw new Error(ctx.err)} },
|
package/package.json
CHANGED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"date": "2023-10-19T08:52:33.010Z",
|
|
3
|
-
"argv": [
|
|
4
|
-
"/Users/jnelas/.nvm/versions/node/v16.18.0/bin/node",
|
|
5
|
-
"/Users/jnelas/reps/cob/cob-cli/test/test_common_environmentHandler.js"
|
|
6
|
-
],
|
|
7
|
-
"execArgv": [
|
|
8
|
-
"--loader=file:///Users/jnelas/reps/cob/cob-cli/node_modules/@isaacs/ts-node-temp-fork-for-pr-2009/esm.mjs",
|
|
9
|
-
"--loader=file:///Users/jnelas/reps/cob/cob-cli/node_modules/@tapjs/mock/dist/esm/legacy-loader.mjs",
|
|
10
|
-
"--no-warnings",
|
|
11
|
-
"--enable-source-maps",
|
|
12
|
-
"--loader=file:///Users/jnelas/reps/cob/cob-cli/node_modules/@tapjs/processinfo/dist/esm/loader-legacy.mjs"
|
|
13
|
-
],
|
|
14
|
-
"NODE_OPTIONS": "\"--loader=file:///Users/jnelas/reps/cob/cob-cli/node_modules/@tapjs/processinfo/dist/esm/loader-legacy.mjs\" \"--no-warnings\"",
|
|
15
|
-
"cwd": "/Users/jnelas/reps/cob/cob-cli",
|
|
16
|
-
"pid": 12082,
|
|
17
|
-
"ppid": 12080,
|
|
18
|
-
"parent": null,
|
|
19
|
-
"uuid": "0db03a1d-f054-4ba8-9873-7efb81723721",
|
|
20
|
-
"files": [
|
|
21
|
-
"/Users/jnelas/reps/cob/cob-cli/test/test_common_environmentHandler.js",
|
|
22
|
-
"/Users/jnelas/reps/cob/cob-cli/lib/task_lists/common_enviromentHandler.js",
|
|
23
|
-
"/Users/jnelas/reps/cob/cob-cli/lib/task_lists/common_releaseManager.js",
|
|
24
|
-
"/Users/jnelas/reps/cob/cob-cli/lib/task_lists/common_helpers.js"
|
|
25
|
-
],
|
|
26
|
-
"sources": {},
|
|
27
|
-
"root": "0db03a1d-f054-4ba8-9873-7efb81723721",
|
|
28
|
-
"externalID": "test/test_common_environmentHandler.js",
|
|
29
|
-
"code": 0,
|
|
30
|
-
"signal": null,
|
|
31
|
-
"runtime": 1840.771843
|
|
32
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"date": "2023-10-19T08:52:33.000Z",
|
|
3
|
-
"argv": [
|
|
4
|
-
"/Users/jnelas/.nvm/versions/node/v16.18.0/bin/node",
|
|
5
|
-
"/Users/jnelas/reps/cob/cob-cli/lib/commands/test.js"
|
|
6
|
-
],
|
|
7
|
-
"execArgv": [
|
|
8
|
-
"--loader=file:///Users/jnelas/reps/cob/cob-cli/node_modules/@isaacs/ts-node-temp-fork-for-pr-2009/esm.mjs",
|
|
9
|
-
"--loader=file:///Users/jnelas/reps/cob/cob-cli/node_modules/@tapjs/mock/dist/esm/legacy-loader.mjs",
|
|
10
|
-
"--no-warnings",
|
|
11
|
-
"--enable-source-maps",
|
|
12
|
-
"--loader=file:///Users/jnelas/reps/cob/cob-cli/node_modules/@tapjs/processinfo/dist/esm/loader-legacy.mjs"
|
|
13
|
-
],
|
|
14
|
-
"NODE_OPTIONS": "\"--loader=file:///Users/jnelas/reps/cob/cob-cli/node_modules/@tapjs/processinfo/dist/esm/loader-legacy.mjs\" \"--no-warnings\"",
|
|
15
|
-
"cwd": "/Users/jnelas/reps/cob/cob-cli",
|
|
16
|
-
"pid": 12081,
|
|
17
|
-
"ppid": 12080,
|
|
18
|
-
"parent": null,
|
|
19
|
-
"uuid": "9d97e24f-ae90-4c49-af20-075bbcc46260",
|
|
20
|
-
"files": [
|
|
21
|
-
"/Users/jnelas/reps/cob/cob-cli/lib/commands/test.js",
|
|
22
|
-
"/Users/jnelas/reps/cob/cob-cli/lib/task_lists/test_validate.js",
|
|
23
|
-
"/Users/jnelas/reps/cob/cob-cli/lib/task_lists/common_helpers.js",
|
|
24
|
-
"/Users/jnelas/reps/cob/cob-cli/lib/task_lists/common_releaseManager.js",
|
|
25
|
-
"/Users/jnelas/reps/cob/cob-cli/lib/task_lists/common_syncFiles.js",
|
|
26
|
-
"/Users/jnelas/reps/cob/cob-cli/lib/task_lists/test_otherFilesContiousReload.js",
|
|
27
|
-
"/Users/jnelas/reps/cob/cob-cli/lib/task_lists/test_syncFile.js",
|
|
28
|
-
"/Users/jnelas/reps/cob/cob-cli/lib/task_lists/test_customUIsContinuosReload.js",
|
|
29
|
-
"/Users/jnelas/reps/cob/cob-cli/lib/task_lists/common_enviromentHandler.js",
|
|
30
|
-
"/Users/jnelas/reps/cob/cob-cli/lib/commands/upgradeRepo.js"
|
|
31
|
-
],
|
|
32
|
-
"sources": {},
|
|
33
|
-
"root": "9d97e24f-ae90-4c49-af20-075bbcc46260",
|
|
34
|
-
"externalID": "lib/commands/test.js",
|
|
35
|
-
"code": 0,
|
|
36
|
-
"signal": null,
|
|
37
|
-
"runtime": 290.537245
|
|
38
|
-
}
|
package/.tap/repl_history
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[CoB] Starting live-reload
|
|
File without changes
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
TAP version 14
|
|
2
|
-
# Subtest: smoke
|
|
3
|
-
ok 1 - should match pattern
|
|
4
|
-
1..1
|
|
5
|
-
ok 1 - smoke # time=33.202ms
|
|
6
|
-
|
|
7
|
-
# Subtest: there's an ENV file, but no default
|
|
8
|
-
ok 1 - should match pattern
|
|
9
|
-
ok 2 - should be equal
|
|
10
|
-
ok 3 - should match pattern
|
|
11
|
-
ok 4 - should match pattern
|
|
12
|
-
ok 5 - should be equal
|
|
13
|
-
1..5
|
|
14
|
-
ok 2 - there's an ENV file, but no default # time=266.343ms
|
|
15
|
-
|
|
16
|
-
# Subtest: there's an ENV and a default
|
|
17
|
-
ok 1 - should match pattern
|
|
18
|
-
ok 2 - should match pattern
|
|
19
|
-
ok 3 - should match pattern
|
|
20
|
-
ok 4 - should be equal
|
|
21
|
-
1..4
|
|
22
|
-
ok 3 - there's an ENV and a default # time=411.658ms
|
|
23
|
-
|
|
24
|
-
# Subtest: there's multiple ENVs but no default
|
|
25
|
-
ok 1 - should match pattern
|
|
26
|
-
ok 2 - should match pattern
|
|
27
|
-
ok 3 - should match pattern
|
|
28
|
-
ok 4 - should be equal
|
|
29
|
-
1..4
|
|
30
|
-
ok 4 - there's multiple ENVs but no default # time=274.577ms
|
|
31
|
-
|
|
32
|
-
# Subtest: there's multiple ENVs and a default
|
|
33
|
-
ok 1 - should match pattern
|
|
34
|
-
ok 2 - should match pattern
|
|
35
|
-
ok 3 - should match pattern
|
|
36
|
-
ok 4 - should be equal
|
|
37
|
-
1..4
|
|
38
|
-
ok 5 - there's multiple ENVs and a default # time=403.779ms
|
|
39
|
-
|
|
40
|
-
1..5
|