add deploy script

This commit is contained in:
jack 2018-04-27 22:04:30 +08:00
parent 7eed5f6837
commit 26a0e8775e
2 changed files with 37 additions and 0 deletions

20
package.json Normal file
View File

@ -0,0 +1,20 @@
{
"name": "poles",
"version": "1.0.0",
"private": true,
"description": "www.poles.ac.cn website",
"main": "index.js",
"scripts": {
"test": "npm test",
"d": "shipit main deploy"
},
"repository": {
"type": "git",
"url": "git@git.westgis.ac.cn:westdc/westdc-zf1.git"
},
"keywords": [
"poles"
],
"author": "jianxuanli",
"license": "ISC"
}

17
shipitfile.js Normal file
View File

@ -0,0 +1,17 @@
module.exports = function (shipit) {
shipit.initConfig({
main: {
servers: 'lijianxuan@sj'
}
});
shipit.task('deploy', async function () {
try{
await shipit.remote('sudo /usr/bin/git pull', {'cwd': '/var/www/poles.ac.cn'});
// await shipit.remote('/usr/local/bin/pm2 restart henan', {'cwd': '/home/mapljx/henan/henanWeb'});
}catch (e){
console.log(e.message);
}
});
};