cob-cli 2.46.0-beta.7 → 2.46.0-beta.8
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/commands/getDefs.js
CHANGED
|
@@ -10,11 +10,11 @@ async function getDefs(args) {
|
|
|
10
10
|
const cmdEnv = await getCurrentCommandEnviroment(args)
|
|
11
11
|
|
|
12
12
|
console.log(`Getting definitions from ${cmdEnv.serverStr} to branch ${cmdEnv.branchStr} ...` );
|
|
13
|
-
const getDefs = spawn(path.resolve(__dirname,"..","task_lists","getDefs.sh"),[cmdEnv.
|
|
13
|
+
const getDefs = spawn(path.resolve(__dirname,"..","task_lists","getDefs.sh"),[cmdEnv.serverHTTPs, cmdEnv.name, path.resolve(__dirname) ])
|
|
14
14
|
getDefs.stdout.on('data', function (data) { console.log(" " + data.toString()); });
|
|
15
15
|
getDefs.on('exit', function () { console.log('Done!'); });
|
|
16
16
|
} catch(err) {
|
|
17
17
|
console.error("\n",err.message);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
module.exports = getDefs;
|
|
20
|
+
module.exports = getDefs;
|
package/lib/commands/init.js
CHANGED
|
@@ -16,7 +16,7 @@ async function init(servername,args) {
|
|
|
16
16
|
let initTasks;
|
|
17
17
|
if(await projectExistsInGitAccount(projectName,args.repoaccount) ) {
|
|
18
18
|
console.log("\nRepo cloned!".green);
|
|
19
|
-
} else if( projectPathOkFor(projectName) && await notInsideGitRepo() && await validCobServer(cmdEnv.
|
|
19
|
+
} else if( projectPathOkFor(projectName) && await notInsideGitRepo() && await validCobServer(cmdEnv.serverHTTPs)) {
|
|
20
20
|
console.log("\nCreating project", projectName.bold.blue );
|
|
21
21
|
initTasks = newProjectTasks(cmdEnv, projectName, repo, args )
|
|
22
22
|
initTasks.run()
|
|
@@ -76,4 +76,4 @@ async function projectExistsInGitAccount(projectName, repoaccount) {
|
|
|
76
76
|
} catch (e) {
|
|
77
77
|
return false
|
|
78
78
|
}
|
|
79
|
-
}
|
|
79
|
+
}
|
|
@@ -15,7 +15,8 @@ async function getCurrentCommandEnviroment(args, newServername) {
|
|
|
15
15
|
|
|
16
16
|
const defaultEnvironmentServerName = newServername ? newServername : _getDefaultServerForEnvironment(environmentName);
|
|
17
17
|
const servername = args.servername ? args.servername : defaultEnvironmentServerName;
|
|
18
|
-
const server =
|
|
18
|
+
const server = _getServerSSHFQDN(servername)
|
|
19
|
+
const serverHTTPs = _getServerHTTPsFQDN(servername)
|
|
19
20
|
const currentBranch = newServername ? "master" : await getCurrentBranch();
|
|
20
21
|
|
|
21
22
|
const lastEnvironmentDeployedToServer = await _getLastEnvironmentDeployed(server)
|
|
@@ -47,6 +48,7 @@ async function getCurrentCommandEnviroment(args, newServername) {
|
|
|
47
48
|
name: environmentName,
|
|
48
49
|
servername: servername,
|
|
49
50
|
server: server,
|
|
51
|
+
serverHTTPs: serverHTTPs,
|
|
50
52
|
serverStr: serverStr,
|
|
51
53
|
currentBranch: currentBranch,
|
|
52
54
|
branchStr: branchStr,
|
|
@@ -117,10 +119,15 @@ function _getDefaultServerForEnvironment(environmentName) {
|
|
|
117
119
|
}
|
|
118
120
|
|
|
119
121
|
/* ************************************ */
|
|
120
|
-
function
|
|
122
|
+
function _getServerSSHFQDN(servername) {
|
|
121
123
|
return servername + ".cultofbits.pt";
|
|
122
124
|
}
|
|
123
125
|
|
|
126
|
+
/* ************************************ */
|
|
127
|
+
function _getServerHTTPsFQDN(servername) {
|
|
128
|
+
return servername + ".cultofbits.com";
|
|
129
|
+
}
|
|
130
|
+
|
|
124
131
|
/* ************************************ */
|
|
125
132
|
async function _getLastEnvironmentDeployed(server) {
|
|
126
133
|
try {
|
|
@@ -140,4 +147,4 @@ async function _setLastEnvironmentDeployed(server, environmentName) {
|
|
|
140
147
|
async function _setupEnvironment(environmentName, servername, server) {
|
|
141
148
|
await fs.mkdirs("environments/" + environmentName);
|
|
142
149
|
await fs.writeFile("environments/" + environmentName + "/server", servername);
|
|
143
|
-
}
|
|
150
|
+
}
|
|
@@ -9,7 +9,7 @@ const exec = util.promisify(child_process.exec);
|
|
|
9
9
|
|
|
10
10
|
async function customUIsContinuosReload(cmdEnv, dashboard) {
|
|
11
11
|
process.env.dash_dir = dashboard
|
|
12
|
-
process.env.server = "https://" + cmdEnv.
|
|
12
|
+
process.env.server = "https://" + cmdEnv.serverHTTPs
|
|
13
13
|
|
|
14
14
|
let commands = []
|
|
15
15
|
let isStopping = false;
|
package/package.json
CHANGED