Auto Deployment
一键部署前端项目。
Features
- 选择“Build & Deploy”来构建您的项目并将其部署到远程服务器。
- 选择“仅部署”以将项目构建目录部署到远程服务器。
命令选项板中的命令:
扩展插件设置
两个settings.json示例:
选择“Build & Deploy”在本地构建项目并将dist上传到远程服务器。
{
"autoDeployment.config": {
"configurations": [
{
"name": "dev",
"local": {
"projectPath": ".",
"buildCmd": "yarn build",
"outputDir": "dist"
},
"remote": {
"deploymentPath": "~/nginx/html",
"backupOriginalFiles": true,
"backupTo": "~/backup",
"deleteOriginalFiles": true
},
"ssh": {
"host": "192.168.1.200",
"port": 22,
"username": "pi",
"privateKey": "~/.ssh/id_rsa"
}
}
]
}
}
选择“Deploy Only”将项目源代码上载到远程服务器,并执行脚本在远程服务器上进行构建和部署。
{
"autoDeployment.config": {
"configurations": [
{
"name": "dev",
"local": {
"projectPath": ".",
"outputDir": ".",
"exclude": ["**/node_modules/**", "dist/**"]
},
"remote": {
"deploymentPath": "~/web/projects/demo",
"deleteOriginalFiles": true,
"postCmd": "bash ./build_and_deploy.sh"
},
"ssh": {
"host": "192.168.1.200",
"port": 22,
"username": "pi",
"privateKey": "~/.ssh/id_rsa"
}
}
]
}
}
每个配置项的详细信息如下: