| | |
| | | const { uploadFiles, customerList } = require('./helper'); |
| | | const { uploadFiles, customerList, checkCustomer, changeBranch,deployEnv } = require('./helper'); |
| | | const { execSync } = require('child_process'); |
| | | |
| | | if (!customerList || customerList.length === 0) { |
| | | logError(`请正确使用命令 “npm run deploy [customer1,customer2,customer3,...]”, |
| | | 部署到生产环境写法:customer:pro |
| | | `); |
| | | process.exit(1); // 退出脚本 |
| | | exit(); // 退出脚本 |
| | | } |
| | | const myEnv = deployEnv==='pro'?'prod':'dev' |
| | | changeBranch(); |
| | | |
| | | uploadFiles('npm run deploy'); |
| | | checkCustomer('npm run deploy'); |
| | | |
| | | // uploadFiles(); |
| | | try { |
| | | execSync(`npx deploy ${myEnv}`, { stdio: 'inherit' }); |
| | | } catch (error) {} |
| | | |
| | | |