@teams-max/mwsp 2.0.3 → 2.0.4
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/es/cli/build.js +1 -1
- package/es/utils/index.js +9 -9
- package/lib/cli/build.js +1 -1
- package/lib/utils/index.js +8 -8
- package/package.json +1 -1
package/es/cli/build.js
CHANGED
package/es/utils/index.js
CHANGED
|
@@ -62,7 +62,7 @@ function getCfg() {
|
|
|
62
62
|
var args = yParser(process.argv.slice(2));
|
|
63
63
|
var JENKINS_BUILD = args.jenkinsBuild || args.JENKINSBUILD || args.jenkins_build || args.JENKINS_BUILD;
|
|
64
64
|
var APP_ENV = args.env || args.ENV || '';
|
|
65
|
-
var
|
|
65
|
+
var ASG_BRANCH = args.asg_branch || args.ASG_BRANCH || '';
|
|
66
66
|
var RESOURCE_URL = '';
|
|
67
67
|
var SUB_APP = '';
|
|
68
68
|
var archStr = 'unknown';
|
|
@@ -81,7 +81,7 @@ function getCfg() {
|
|
|
81
81
|
},
|
|
82
82
|
ASG_DIR: asgDir,
|
|
83
83
|
JENKINS_BUILD: JENKINS_BUILD,
|
|
84
|
-
|
|
84
|
+
ASG_BRANCH: ASG_BRANCH,
|
|
85
85
|
APP_ENV: APP_ENV,
|
|
86
86
|
RESOURCE_URL: RESOURCE_URL,
|
|
87
87
|
SUB_APP: SUB_APP
|
|
@@ -108,12 +108,12 @@ function fetchRemoteRepository() {
|
|
|
108
108
|
}
|
|
109
109
|
function _fetchRemoteRepository() {
|
|
110
110
|
_fetchRemoteRepository = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
111
|
-
var cfg, infra, directory,
|
|
111
|
+
var cfg, infra, directory, ASG_BRANCH, JENKINS_BUILD, remoteUrl, doesExist, proDevDeps, proDeps, maxDevDeps, maxDeps, _yield$inquirer$promp, syncUp, infraBranchsOutput, infraBranchArray, filteredBranches, defaultBrancheIdx, questions;
|
|
112
112
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
113
113
|
while (1) switch (_context.prev = _context.next) {
|
|
114
114
|
case 0:
|
|
115
115
|
cfg = getCfg();
|
|
116
|
-
infra = cfg.infra, directory = cfg.ASG_DIR,
|
|
116
|
+
infra = cfg.infra, directory = cfg.ASG_DIR, ASG_BRANCH = cfg.ASG_BRANCH, JENKINS_BUILD = cfg.JENKINS_BUILD;
|
|
117
117
|
remoteUrl = infra.url;
|
|
118
118
|
doesExist = checkDirectoryExistsSync(directory);
|
|
119
119
|
if (doesExist) {
|
|
@@ -175,7 +175,7 @@ function _fetchRemoteRepository() {
|
|
|
175
175
|
_context.next = 48;
|
|
176
176
|
break;
|
|
177
177
|
case 36:
|
|
178
|
-
if (!(JENKINS_BUILD && !
|
|
178
|
+
if (!(JENKINS_BUILD && !ASG_BRANCH)) {
|
|
179
179
|
_context.next = 41;
|
|
180
180
|
break;
|
|
181
181
|
}
|
|
@@ -202,7 +202,7 @@ function _fetchRemoteRepository() {
|
|
|
202
202
|
}
|
|
203
203
|
return _context.abrupt("return");
|
|
204
204
|
case 48:
|
|
205
|
-
if (!(!doesExist && JENKINS_BUILD && !
|
|
205
|
+
if (!(!doesExist && JENKINS_BUILD && !ASG_BRANCH)) {
|
|
206
206
|
_context.next = 51;
|
|
207
207
|
break;
|
|
208
208
|
}
|
|
@@ -213,12 +213,12 @@ function _fetchRemoteRepository() {
|
|
|
213
213
|
process.chdir(directory);
|
|
214
214
|
_context.prev = 53;
|
|
215
215
|
execa.sync('git', ['fetch', 'origin', '--prune']);
|
|
216
|
-
if (!(JENKINS_BUILD &&
|
|
216
|
+
if (!(JENKINS_BUILD && ASG_BRANCH)) {
|
|
217
217
|
_context.next = 60;
|
|
218
218
|
break;
|
|
219
219
|
}
|
|
220
|
-
execa.sync('git', ['checkout',
|
|
221
|
-
logStep("Anto switched to branch:",
|
|
220
|
+
execa.sync('git', ['checkout', ASG_BRANCH]);
|
|
221
|
+
logStep("Anto switched to branch:", ASG_BRANCH);
|
|
222
222
|
_context.next = 70;
|
|
223
223
|
break;
|
|
224
224
|
case 60:
|
package/lib/cli/build.js
CHANGED
package/lib/utils/index.js
CHANGED
|
@@ -41,7 +41,7 @@ function getCfg() {
|
|
|
41
41
|
const args = yParser(process.argv.slice(2));
|
|
42
42
|
const JENKINS_BUILD = args.jenkinsBuild || args.JENKINSBUILD || args.jenkins_build || args.JENKINS_BUILD;
|
|
43
43
|
const APP_ENV = args.env || args.ENV || "";
|
|
44
|
-
const
|
|
44
|
+
const ASG_BRANCH = args.asg_branch || args.ASG_BRANCH || "";
|
|
45
45
|
let RESOURCE_URL = "";
|
|
46
46
|
let SUB_APP = "";
|
|
47
47
|
let archStr = "unknown";
|
|
@@ -60,7 +60,7 @@ function getCfg() {
|
|
|
60
60
|
},
|
|
61
61
|
ASG_DIR: asgDir,
|
|
62
62
|
JENKINS_BUILD,
|
|
63
|
-
|
|
63
|
+
ASG_BRANCH,
|
|
64
64
|
APP_ENV,
|
|
65
65
|
RESOURCE_URL,
|
|
66
66
|
SUB_APP
|
|
@@ -80,7 +80,7 @@ function checkDirectoryExistsSync(dirPath) {
|
|
|
80
80
|
}
|
|
81
81
|
async function fetchRemoteRepository() {
|
|
82
82
|
const cfg = getCfg();
|
|
83
|
-
const { infra, ASG_DIR: directory,
|
|
83
|
+
const { infra, ASG_DIR: directory, ASG_BRANCH, JENKINS_BUILD } = cfg;
|
|
84
84
|
const remoteUrl = infra.url;
|
|
85
85
|
const doesExist = checkDirectoryExistsSync(directory);
|
|
86
86
|
if (!doesExist) {
|
|
@@ -112,7 +112,7 @@ async function fetchRemoteRepository() {
|
|
|
112
112
|
!!maxDeps.length && await exec("pnpm", ["add", ...maxDeps]);
|
|
113
113
|
}
|
|
114
114
|
logStep("Installation completed.");
|
|
115
|
-
} else if (JENKINS_BUILD && !
|
|
115
|
+
} else if (JENKINS_BUILD && !ASG_BRANCH) {
|
|
116
116
|
logStep("Jenkins build detected. Skipping sync up.");
|
|
117
117
|
return;
|
|
118
118
|
} else {
|
|
@@ -129,7 +129,7 @@ async function fetchRemoteRepository() {
|
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
-
if (!doesExist && JENKINS_BUILD && !
|
|
132
|
+
if (!doesExist && JENKINS_BUILD && !ASG_BRANCH) {
|
|
133
133
|
printErrorAndExit(
|
|
134
134
|
"Jenkins build detected. The branch parameter is missing!"
|
|
135
135
|
);
|
|
@@ -139,9 +139,9 @@ async function fetchRemoteRepository() {
|
|
|
139
139
|
process.chdir(directory);
|
|
140
140
|
try {
|
|
141
141
|
execa.sync("git", ["fetch", "origin", "--prune"]);
|
|
142
|
-
if (JENKINS_BUILD &&
|
|
143
|
-
execa.sync("git", ["checkout",
|
|
144
|
-
logStep(`Anto switched to branch:`,
|
|
142
|
+
if (JENKINS_BUILD && ASG_BRANCH) {
|
|
143
|
+
execa.sync("git", ["checkout", ASG_BRANCH]);
|
|
144
|
+
logStep(`Anto switched to branch:`, ASG_BRANCH);
|
|
145
145
|
} else {
|
|
146
146
|
const infraBranchsOutput = execa.sync("git", ["branch", "-r"]).stdout;
|
|
147
147
|
const infraBranchArray = infraBranchsOutput.trim().split("\n");
|