@taole/deploy-helper 1.0.0-beta.0 → 1.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/deploy.mjs CHANGED
@@ -5,7 +5,7 @@ import { simpleGit } from 'simple-git';
5
5
  import { getScpClient, TEST_SERVER_HOST } from './util.mjs';
6
6
 
7
7
 
8
- class Deployer {
8
+ export default class Deployer {
9
9
  async deploy(workDir, mode, config) {
10
10
  // 检查配置中是否存在默认值(CHANGE_ME)
11
11
  const result = hasChangeMe(JSON.stringify(config));
@@ -199,6 +199,3 @@ class Deployer {
199
199
  await runPipeline(config, mode);
200
200
  }
201
201
  }
202
-
203
-
204
- export default new Deployer();
package/deploy2.mjs CHANGED
@@ -1,9 +1,6 @@
1
- class Deployer2 {
1
+ export default class Deployer2 {
2
2
  async deploy(workDir, mode, config) {
3
3
  // check
4
4
  // run
5
5
  }
6
6
  }
7
-
8
-
9
- export default new Deployer2();
package/index.mjs CHANGED
@@ -78,11 +78,10 @@ async function getVersion() {
78
78
  }
79
79
 
80
80
 
81
- function getDeployer(){
81
+ function getDeployer() {
82
82
  return new Deployer();
83
83
  }
84
84
 
85
-
86
85
  async function main() {
87
86
  const version = await getVersion();
88
87
 
@@ -179,9 +178,9 @@ async function main() {
179
178
  const mode = process.argv[2] === 'prod' ? 'prod' : 'test'; // 部署环境
180
179
  log(`deploy mode: ${mode}`);
181
180
  log(`workDir: ${workDir}`);
181
+ const deployer = getDeployer();
182
182
 
183
183
  const config = await loadConfig();
184
- const deployer = getDeployer();
185
184
  await deployer.deploy(workDir, mode, config);
186
185
  log(`deploy-helper deploy done.`);
187
186
  process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taole/deploy-helper",
3
- "version": "1.0.0-beta.0",
3
+ "version": "1.0.0-beta.1",
4
4
  "description": "脚本部署工具,用于将项目部署到测试环境或生产环境",
5
5
  "main": "index.mjs",
6
6
  "type": "module",