1
0
Fork 0

Fixed deploy commands

This commit is contained in:
Michaël Lemaire 2018-06-26 23:50:51 +02:00
parent 26ee6c12bb
commit de6576f42d
3 changed files with 13 additions and 6 deletions

View File

@ -4,6 +4,7 @@ To-Do-list
Phaser 3 migration
------------------
* Restore fullscreen mode (and add a fullscreen incentive before the menu)
* Fix valuebar requiring to be in root display list
* Restore unit tests about boundaries (in UITools)

View File

@ -8,7 +8,8 @@
"test": "run ci",
"start": "run continuous",
"codecov": "remap-istanbul -i out/coverage/coverage.json -o out/coverage/mapped.json -t json && codecov -f out/coverage/mapped.json",
"deploy": "run deploy"
"deploy": "run deploy",
"deployx": "run deployx"
},
"repository": {
"type": "git",
@ -42,4 +43,4 @@
"phaser": "^3.10.0",
"process-pool": "^0.3.5"
}
}
}

View File

@ -177,13 +177,17 @@ async function optimize() {
/**
* Deploy to production
*/
async function deploy(task) {
async function deploy(task, experimental = false) {
await build(true);
await optimize();
await exec(`rsync -avz --delete ./out/ hosting.thunderk.net:/srv/website/spacetac${experimental ? "x" : ""}/`);
}
let branch = await run('git rev-parse --abbrev-ref HEAD', { stdio: 'pipe', async: true });
let suffix = (branch == "master") ? "" : "x";
await exec(`rsync -avz --delete ./out/ hosting.thunderk.net:/srv/website/spacetac${suffix}/`);
/**
* Deploy to production (experimental)
*/
async function deployx(task) {
await deploy(task, true);
}
/**
@ -265,6 +269,7 @@ module.exports = {
build: command(build),
test: command(test),
deploy: command(deploy),
deployx: command(deployx),
serve: command(serve),
continuous: command(continuous),
ci: command(ci)