|
|
@ -11,15 +11,16 @@ const logger = new Logger('deploy', 'info', 'brightMagenta');
|
|
|
|
|
|
|
|
|
|
|
|
const sync = browsersync.create('lugit')
|
|
|
|
const sync = browsersync.create('lugit')
|
|
|
|
|
|
|
|
|
|
|
|
sync.init({
|
|
|
|
export async function deploy(srcPath, distPath, serverPath, serviceName, file = null, live = false) {
|
|
|
|
proxy: 'http://lugit.local',
|
|
|
|
|
|
|
|
port: 8080,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export async function deploy(srcPath, distPath, serverPath, serviceName, file = null) {
|
|
|
|
|
|
|
|
logger.info('Deploying...');
|
|
|
|
logger.info('Deploying...');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(live && !sync.active) {
|
|
|
|
|
|
|
|
sync.init({
|
|
|
|
|
|
|
|
proxy: 'http://lugit.local',
|
|
|
|
|
|
|
|
port: 8080,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let shouldRestart = true;
|
|
|
|
let shouldRestart = true;
|
|
|
|
|
|
|
|
|
|
|
|
// check if it's an scss
|
|
|
|
// check if it's an scss
|
|
|
@ -34,7 +35,7 @@ export async function deploy(srcPath, distPath, serverPath, serviceName, file =
|
|
|
|
await copyTo(distPath, serverPath);
|
|
|
|
await copyTo(distPath, serverPath);
|
|
|
|
shouldRestart && await restartService(serviceName);
|
|
|
|
shouldRestart && await restartService(serviceName);
|
|
|
|
|
|
|
|
|
|
|
|
if(!shouldRestart) {
|
|
|
|
if(!shouldRestart && live) {
|
|
|
|
sync.reload();
|
|
|
|
sync.reload();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|