@next-core/brick-container 3.21.15 → 3.22.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.
@@ -0,0 +1,26 @@
1
+ #!/bin/bash
2
+
3
+ # easyops 安装根目录
4
+ install_base="/usr/local/easyops"
5
+
6
+ plugin_name='brick_next_v3'
7
+
8
+ install_path="${install_base}/${plugin_name}"
9
+
10
+ deploy_init_path="/usr/local/easyops/deploy_init"
11
+ config_tool="${deploy_init_path}/tools/config_tool"
12
+
13
+ export LD_LIBRARY_PATH=/usr/local/easyops/ens_client/sdk:${LD_LIBRARY_PATH}
14
+
15
+
16
+ value=$(${config_tool} get --appID "deploy_init" --namespaceName "common" --key "check_auth_token.enable")
17
+ if [[ ${value} == "true" ]]; then
18
+ # 初始化默认命名空间,并生成 clientId 和 secret
19
+ ${config_tool} init -f "${install_path}/conf/config.yaml"
20
+ if [[ $? -ne 0 ]];then
21
+ echo "init brick_next_v3 config namespace error, exit"
22
+ exit 1
23
+ fi
24
+ fi
25
+
26
+
@@ -7,6 +7,10 @@ plugin_name='brick_next_v3'
7
7
 
8
8
  install_path="${install_base}/${plugin_name}"
9
9
 
10
+ deploy_init_path="/usr/local/easyops/deploy_init"
11
+ config_tool="${deploy_init_path}/tools/config_tool"
12
+
13
+
10
14
  function check_service_availability() {
11
15
  services=$1
12
16
  for service in ${services[*]}; do
@@ -45,12 +49,26 @@ function report_package() {
45
49
  fi
46
50
  }
47
51
 
52
+ export LD_LIBRARY_PATH=/usr/local/easyops/ens_client/sdk:${LD_LIBRARY_PATH}
53
+
48
54
  # 优先取环境变量里面的org
49
55
  if [[ ${org}X == X ]]; then
50
56
  org=$(/usr/local/easyops/deploy_init/tools/get_env.py common org)
51
57
  [[ $? -ne 0 ]] && echo "get org error, exit" && exit 1
52
58
  fi
53
59
 
60
+
61
+ value=$(${config_tool} get --appID "deploy_init" --namespaceName "common" --key "check_auth_token.enable")
62
+ if [[ ${value} == "true" ]]; then
63
+ # 初始化默认命名空间,并生成 clientId 和 secret
64
+ ${config_tool} init -f "${install_path}/conf/config.yaml"
65
+ if [[ $? -ne 0 ]];then
66
+ echo "import brick_next_v3 config namespace error, exit"
67
+ exit 1
68
+ fi
69
+ fi
70
+
71
+
54
72
  # 上报当前安装小产品
55
73
  check_service
56
74
  report_package ${install_base} ${org} ${install_path}