@winner-fed/winner-deploy 3.3.0 → 3.3.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@winner-fed/winner-deploy",
3
- "version": "3.3.0",
3
+ "version": "3.3.3",
4
4
  "description": "Generate a publication deployed by the See platform",
5
5
  "keywords": [
6
6
  "winner",
@@ -70,6 +70,7 @@
70
70
  "prettier": "^2.1.2"
71
71
  },
72
72
  "publishConfig": {
73
- "access": "public"
73
+ "access": "public",
74
+ "registry": "https://registry.npmjs.org/"
74
75
  }
75
76
  }
@@ -51,15 +51,15 @@ exports.genDockerPackage = function genDockerPackage (seePackageName, options, h
51
51
  fs.ensureDirSync(`${tmp}/template`)
52
52
 
53
53
  if (isWinnerProject()) {
54
- fs.outputFileSync(`./${tmp}/template/config.local.js`, template ? genTemplate(template, variables) : '')
54
+ fs.outputFileSync(`./${tmp}/template/${name}/config.local.js`, template ? genTemplate(template, variables) : '')
55
55
  } else if (isProProject() || isProProject(name)) { // 子包目录 dist/'name'/sysconfig.js
56
56
  // 这里做了默认重写
57
57
  // 兼容操作员中心产品
58
58
  configFileName = 'sysconfig';
59
- fs.outputFileSync(`./${tmp}/template/sysconfig.js`, template ? genTemplate(template, variables) : '')
59
+ fs.outputFileSync(`./${tmp}/template/${name}/sysconfig.js`, template ? genTemplate(template, variables) : '')
60
60
  } else {
61
61
  // 自定义配置文件的名字
62
- fs.outputFileSync(`./${tmp}/template/${configFileName}.js`, template ? genTemplate(template, variables) : '')
62
+ fs.outputFileSync(`./${tmp}/template/${name}/${configFileName}.js`, template ? genTemplate(template, variables) : '')
63
63
  }
64
64
 
65
65
  // 生成 k8s-deploy-res.yaml
@@ -29,7 +29,7 @@
29
29
  <variables describe="集群基本参数">
30
30
  <field name="user" label="安装用户" type="input">root</field>
31
31
  <field name="workspace" label="前端安装目录" type="input" tooltip="IAR上存放前端根目录">/usr/local/nginx/html</field>
32
- <field name="webAppName" label="前端应用名" type="input" tooltip="与IAR中的location前端目录名称保持一致">{{ name }}</field>
32
+ <field name="webAppName" label="前端应用名" type="input" tooltip="前端部署完成后访问的站点名称;需要与IAR中的location前端目录名称保持一致">{{ name }}</field>
33
33
 
34
34
  {{ variables }}
35
35
  </variables>
@@ -16,7 +16,6 @@
16
16
  <variables describe="集群基本参数">
17
17
  <field name="user" label="安装用户" type="input">root</field>
18
18
  <field name="workspace" label="前端安装目录" type="hidden" tooltip="IAR上存放前端目录" >/home/hsiar/hsiar-green/html</field>
19
- <field name="webAppName" label="前端应用名" type="input" tooltip="与IAR中的location前端目录名称保持一致">{{ name }}</field>
20
19
 
21
20
  <!-- K8S部署配置 -->
22
21
  <field name="division_k8s" label="K8S部署配置" type="division" fold="false">
@@ -40,7 +39,7 @@
40
39
 
41
40
  {{ variables }}
42
41
  </variables>
43
- <config path="./${webAppName}/{{ configFileName }}.js" encoding="UTF-8"/>
42
+ <config path="./{{ name }}/{{ configFileName }}.js" encoding="UTF-8"/>
44
43
  <config reference="" encoding="utf-8" path="./k8s-deploy-res.yaml" />
45
44
  <node describe="节点私有配置信息" />
46
45
  </system>
@@ -29,7 +29,7 @@
29
29
  <variables describe="集群基本参数">
30
30
  <field name="user" label="安装用户" type="input">root</field>
31
31
  <field name="workspace" label="前端安装目录" type="input" tooltip="IAR上存放前端根目录">/usr/local/nginx/html</field>
32
- <field name="webAppName" label="前端应用名" type="input" tooltip="与IAR中的location前端目录名称保持一致">{{ name }}</field>
32
+ <field name="webAppName" label="前端应用名" type="input" tooltip="前端部署完成后访问的站点名称;需要与IAR中的location前端目录名称保持一致">{{ name }}</field>
33
33
 
34
34
  {{ variables }}
35
35
  </variables>
@@ -5,9 +5,10 @@
5
5
  import os
6
6
  import utils
7
7
 
8
- name = "{{name}}"
8
+ # 读取 deploy.xml 配置文件定义的 webAppName
9
+ webAppName = "${webAppName}"
9
10
  # TIPS: 执行脚本的路径是在 安装目录 下,对应 deploy.xml 里的 workspace 字段
10
- pkgPath = os.path.join(os.getcwd(), name)
11
+ pkgPath = os.path.join(os.getcwd(), webAppName)
11
12
 
12
13
  def chmodPkg():
13
14
  for root,dirs,files in os.walk(pkgPath):
@@ -21,7 +21,8 @@ except:
21
21
 
22
22
  name = "{{name}}"
23
23
  type = "{{type}}"
24
-
24
+ # 读取 deploy.xml 配置文件定义的 webAppName
25
+ webAppName = "${webAppName}"
25
26
 
26
27
  def install(name, type):
27
28
  conf = os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), "conf")
@@ -46,7 +47,7 @@ def install(name, type):
46
47
  source = ""
47
48
 
48
49
  if(type == "bizframe"):
49
- destinationdir = "./" + name + "/" + fileJson[x]["dir"]
50
+ destinationdir = "./" + webAppName + "/" + fileJson[x]["dir"]
50
51
  source = "./tmp/source/" + fileJson[x]["path"]
51
52
  elif(type == "subsystem"):
52
53
  destinationdir = "./" + fileJson[x]["dir"]
@@ -61,7 +62,7 @@ def install(name, type):
61
62
  os.popen("rm -rf tmp")
62
63
 
63
64
 
64
- utils.clear(name, type)
65
+ utils.clear(webAppName, type)
65
66
 
66
67
  # SEE 在脚本下发的时候会保留 scripts 目录下的内容,造成 conf 中存在多份 manifest
67
68
  os.popen("rm -rf ./scripts/" + name)
@@ -6,7 +6,9 @@ import utils
6
6
 
7
7
  name = "{{name}}"
8
8
  type = "{{type}}"
9
+ # 读取 deploy.xml 配置文件定义的 webAppName
10
+ webAppName = "${webAppName}"
9
11
 
10
- utils.clear(name, type)
12
+ utils.clear(webAppName, type)
11
13
 
12
14
  os.popen("rm -rf ./scripts/" + name)