From 26a0e8775e04ef958c54a00c2276fcec8deeed8e Mon Sep 17 00:00:00 2001 From: jack Date: Fri, 27 Apr 2018 22:04:30 +0800 Subject: [PATCH] add deploy script --- package.json | 20 ++++++++++++++++++++ shipitfile.js | 17 +++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 package.json create mode 100644 shipitfile.js diff --git a/package.json b/package.json new file mode 100644 index 00000000..d4dc3fb5 --- /dev/null +++ b/package.json @@ -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" +} diff --git a/shipitfile.js b/shipitfile.js new file mode 100644 index 00000000..7453f675 --- /dev/null +++ b/shipitfile.js @@ -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); + } + }); + +}; \ No newline at end of file