添加 -n, --gitname 和 -e, --gitemail 参数
This commit is contained in:
parent
8a7fca6223
commit
0840eb01c3
@ -4,12 +4,14 @@
|
|||||||
* 如果是 git
|
* 如果是 git
|
||||||
* -r, --repo: 远程仓库,例如 'https://github.com/ORG/ORG.github.io'
|
* -r, --repo: 远程仓库,例如 'https://github.com/ORG/ORG.github.io'
|
||||||
* -b, --branch: 分支,默认为 master
|
* -b, --branch: 分支,默认为 master
|
||||||
|
* -n, --gitname
|
||||||
|
* -e, --gitemail
|
||||||
* 如果是 web
|
* 如果是 web
|
||||||
* -H, --host: 远程主机
|
* -H, --host: 远程主机
|
||||||
* -P, --port: 远程端口,默认为 22
|
* -P, --port: 远程端口,默认为 22
|
||||||
* -D, --dir: 远程目录,例如 /home/USER/FOLDER
|
* -D, --dir: 远程路径,例如 /home/USER/FOLDER
|
||||||
* -d, --dist: 远程文件夹,例如 www。默认为 dist。
|
* -d, --dist: 远程文件夹,例如 www。默认为 dist。
|
||||||
* -l, --local: 本地文件夹,例如 ../../project/public。默认为 ./dist
|
* -l, --local: 本地路径,例如 ../../project/public。默认为 ./dist
|
||||||
* -u, --user: 用户名
|
* -u, --user: 用户名
|
||||||
* -p, --password: 密码
|
* -p, --password: 密码
|
||||||
* -k, --key: 密钥文件
|
* -k, --key: 密钥文件
|
||||||
|
10
deploy.js
10
deploy.js
@ -29,13 +29,15 @@ try {
|
|||||||
commander
|
commander
|
||||||
.version('1.0', '-v, --version') // 默认是 -V。如果要 -v,就要加 '-v --version'
|
.version('1.0', '-v, --version') // 默认是 -V。如果要 -v,就要加 '-v --version'
|
||||||
.option('-t, --type <type>', `Deploy to server type, web or git. Default to ${Config.deploy.type}`)
|
.option('-t, --type <type>', `Deploy to server type, web or git. Default to ${Config.deploy.type}`)
|
||||||
|
.option('-l, --local <local>', `Local path to copy from. Default to ${Config.deploy.local}`)
|
||||||
.option('-H, --host <host>', `Host IP or domain name of the target server. Default to ${Config.deploy.host}`)
|
.option('-H, --host <host>', `Host IP or domain name of the target server. Default to ${Config.deploy.host}`)
|
||||||
.option('-P, --port <port>', `Ssh port number of the target server. Default to ${Config.deploy.port}`)
|
.option('-P, --port <port>', `Ssh port number of the target server. Default to ${Config.deploy.port}`)
|
||||||
.option('-D, --dir <dir>', `Directory to deploy on the target server. Default to ${Config.deploy.dir}`)
|
.option('-D, --dir <dir>', `Destination path to deploy on the target server. Default to ${Config.deploy.dir}`)
|
||||||
.option('-d, --dist <dist>', `Folder to deploy on the target server. Default to ${Config.deploy.dist}`)
|
.option('-d, --dist <dist>', `Destination folder to deploy on the target server. Default to ${Config.deploy.dist}`)
|
||||||
.option('-r, --repo <repo>', `git repo address. Default to ${Config.deploy.repo}`)
|
.option('-r, --repo <repo>', `git repo address. Default to ${Config.deploy.repo}`)
|
||||||
.option('-b, --branch <branch', `git repo branch. Default to ${Config.deploy.branch}`)
|
.option('-b, --branch <branch', `git repo branch. Default to ${Config.deploy.branch}`)
|
||||||
.option('-l, --local <local>', `Local folder to copy from. Default to ${Config.deploy.local}`)
|
.option('-n, --gitname <name>', `git user name. Default to ${Config.deploy.gitname}`)
|
||||||
|
.option('-e, --gitemail <email>', `git user email. Default to ${Config.deploy.gitemail}`)
|
||||||
.option('-u, --user <user>', `User id to login the target server. Default to ${Config.deploy.user}`)
|
.option('-u, --user <user>', `User id to login the target server. Default to ${Config.deploy.user}`)
|
||||||
.option('-k, --key <key>', `User private key file to login the target server. Default to ${Config.deploy.key}`)
|
.option('-k, --key <key>', `User private key file to login the target server. Default to ${Config.deploy.key}`)
|
||||||
.option('-p, --password <password>', `User password to login the target server. You may have to enclose it in "". Default to "${Config.deploy.password}"`)
|
.option('-p, --password <password>', `User password to login the target server. You may have to enclose it in "". Default to "${Config.deploy.password}"`)
|
||||||
@ -51,6 +53,8 @@ const connection = {
|
|||||||
dist: commander.dist || Config.deploy.dist || 'dist', // 新系统将发布在这个文件夹里。建议为dist,和npm run build产生的目录一致,这样既可以远程自动部署,也可以直接登录服务器手动部署。
|
dist: commander.dist || Config.deploy.dist || 'dist', // 新系统将发布在这个文件夹里。建议为dist,和npm run build产生的目录一致,这样既可以远程自动部署,也可以直接登录服务器手动部署。
|
||||||
repo: commander.repo || Config.deploy.repo,
|
repo: commander.repo || Config.deploy.repo,
|
||||||
branch: commander.branch || Config.deploy.branch || 'master',
|
branch: commander.branch || Config.deploy.branch || 'master',
|
||||||
|
gitname: commander.gitname || Config.deploy.gitname,
|
||||||
|
gitemail: commander.gitemail || Config.deploy.gitemail,
|
||||||
local: commander.local || Config.deploy.local || './dist',
|
local: commander.local || Config.deploy.local || './dist',
|
||||||
username: commander.user || Config.deploy.user,
|
username: commander.user || Config.deploy.user,
|
||||||
privateKey: fs.existsSync(privateKeyFile) ? privateKeyFile : undefined,
|
privateKey: fs.existsSync(privateKeyFile) ? privateKeyFile : undefined,
|
||||||
|
Loading…
Reference in New Issue
Block a user