@next-core/brick-container 2.97.10 → 2.98.0
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/install_postscripts.sh +26 -0
- package/deploy/update_postscript.sh +18 -0
- package/dist/{dll.74e57e23.js → dll.67123def.js} +3 -3
- package/dist/{dll.74e57e23.js.map → dll.67123def.js.map} +1 -1
- package/dist/icons--app.bc80361d.js +2 -0
- package/dist/{icons--app.db4b7336.js.map → icons--app.bc80361d.js.map} +1 -1
- package/dist/icons--colored-big-screen.95f612f1.js +2 -0
- package/dist/{icons--colored-big-screen.14a273bf.js.map → icons--colored-big-screen.95f612f1.js.map} +1 -1
- package/dist/icons--default.7113e589.js +2 -0
- package/dist/{icons--default.bcc5f4b2.js.map → icons--default.7113e589.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/main.0429b297dcbee02723dc.js +2 -0
- package/dist/{main.e5a9f4e3b2f3ace7e944.js.map → main.0429b297dcbee02723dc.js.map} +1 -1
- package/dist/{preview.a1c503c44a1b9e182631.js → preview.5ac2ee3c5ce9a68f8477.js} +2 -2
- package/dist/{preview.a1c503c44a1b9e182631.js.map → preview.5ac2ee3c5ce9a68f8477.js.map} +1 -1
- package/dist/preview.html +1 -1
- package/package.json +2 -2
- package/tools/package-union/report_union_micro_app.py +6 -3
- package/tools/report_installed_brick_next_package.py +8 -3
- package/tools/report_installed_theme_template.py +5 -1
- package/tools/utils/__init__.py +0 -0
- package/tools/utils/get_headers.py +27 -0
- package/dist/icons--app.db4b7336.js +0 -2
- package/dist/icons--colored-big-screen.14a273bf.js +0 -2
- package/dist/icons--default.bcc5f4b2.js +0 -2
- package/dist/main.e5a9f4e3b2f3ace7e944.js +0 -2
package/dist/preview.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="zh-CN" data-theme="light" data-mode="default"><head><meta charset="utf-8"/><base href="<!--# echo var='base_href' default='/' -->"/><script>window.DEVELOPER_PREVIEW = true;</script><link href="preview.5fb551513edc8051ce6c.css" rel="stylesheet"></head><body><div id="preview-root"><div id="main-mount-point"></div><div id="bg-mount-point" style="display: none"></div><div id="portal-mount-point"></div></div><script src="dll.
|
|
1
|
+
<!doctype html><html lang="zh-CN" data-theme="light" data-mode="default"><head><meta charset="utf-8"/><base href="<!--# echo var='base_href' default='/' -->"/><script>window.DEVELOPER_PREVIEW = true;</script><link href="preview.5fb551513edc8051ce6c.css" rel="stylesheet"></head><body><div id="preview-root"><div id="main-mount-point"></div><div id="bg-mount-point" style="display: none"></div><div id="portal-mount-point"></div></div><script src="dll.67123def.js"></script><script src="polyfill.3e88f145a0893497373b.js"></script><script src="preview.5ac2ee3c5ce9a68f8477.js"></script></body></html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-core/brick-container",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.98.0",
|
|
4
4
|
"description": "Brick Container Server",
|
|
5
5
|
"homepage": "https://github.com/easyops-cn/next-core/tree/master/packages/brick-container",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"webpack-dev-server": "^4.11.1",
|
|
74
74
|
"webpack-merge": "^5.8.0"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "0048f12938aeae15fe6d60e9fa16542278ad0284"
|
|
77
77
|
}
|
|
@@ -11,6 +11,9 @@ from concurrent.futures import ThreadPoolExecutor,as_completed, wait, ALL_COMPL
|
|
|
11
11
|
reload(sys)
|
|
12
12
|
sys.setdefaultencoding("utf-8")
|
|
13
13
|
|
|
14
|
+
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # 将 tools 目录加入 path
|
|
15
|
+
from utils.get_headers import get_headers
|
|
16
|
+
|
|
14
17
|
# 公共路径
|
|
15
18
|
_INSTALL_BASE_PATH = "/usr/local/easyops"
|
|
16
19
|
_APPLICATIONS_SA_FOLDER = "applications_sa"
|
|
@@ -50,7 +53,7 @@ def get_version(install_path):
|
|
|
50
53
|
def collect_app_info(union_app_id, union_app_version, app_path, report_app_id, version):
|
|
51
54
|
if not os.path.exists(app_path):
|
|
52
55
|
print u"could not find app path {}".format(app_path)
|
|
53
|
-
return
|
|
56
|
+
return
|
|
54
57
|
bootstrap_file_name = ""
|
|
55
58
|
for f in os.listdir(app_path):
|
|
56
59
|
if f.startswith("bootstrap-mini.") and f.endswith(".json"):
|
|
@@ -115,7 +118,7 @@ def report(org, app):
|
|
|
115
118
|
|
|
116
119
|
|
|
117
120
|
def create_or_update_micro_app_sa(org, app):
|
|
118
|
-
headers =
|
|
121
|
+
headers = get_headers(org)
|
|
119
122
|
url = "http://{}/api/v1/micro_app_standalone/report".format(MICRO_APP_SA_ADDR)
|
|
120
123
|
rsp = requests.post(url, json=app, headers=headers)
|
|
121
124
|
rsp.raise_for_status()
|
|
@@ -131,7 +134,7 @@ def import_micro_app_permissions(org, permission_path):
|
|
|
131
134
|
if not os.path.exists(permission_path):
|
|
132
135
|
print "permission path {} does not exist, return...".format(permission_path)
|
|
133
136
|
return
|
|
134
|
-
headers =
|
|
137
|
+
headers = get_headers(org)
|
|
135
138
|
url = "http://{}/api/micro_app/v1/permission/import".format(MICRO_APP_ADDR)
|
|
136
139
|
|
|
137
140
|
print "permission path is {}, will start import permissions".format(permission_path)
|
|
@@ -10,6 +10,9 @@ import tarfile
|
|
|
10
10
|
|
|
11
11
|
from copy import deepcopy
|
|
12
12
|
|
|
13
|
+
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
|
14
|
+
from utils.get_headers import get_headers
|
|
15
|
+
|
|
13
16
|
reload(sys)
|
|
14
17
|
sys.setdefaultencoding("utf-8")
|
|
15
18
|
|
|
@@ -239,7 +242,7 @@ def collect(install_path):
|
|
|
239
242
|
|
|
240
243
|
def report_bricks_atom(org, nb_targz_path, package_name, package_version, bricks_content, stories_content,
|
|
241
244
|
snippets_content):
|
|
242
|
-
headers =
|
|
245
|
+
headers = get_headers(org)
|
|
243
246
|
# report atom
|
|
244
247
|
atom_url = "http://{}/api/v1/brick/atom/import".format(MICRO_APP_ADDR)
|
|
245
248
|
data_dict = {"stories": stories_content, "bricks": bricks_content}
|
|
@@ -258,7 +261,8 @@ def report_bricks_atom(org, nb_targz_path, package_name, package_version, bricks
|
|
|
258
261
|
|
|
259
262
|
def report_brick_next_package(org, brick_targz_path, package_name, package_version):
|
|
260
263
|
# report brick_next or NT
|
|
261
|
-
headers =
|
|
264
|
+
headers = get_headers(org)
|
|
265
|
+
|
|
262
266
|
# report atom
|
|
263
267
|
atom_url = "http://{}/api/v1/brick_next/report".format(MICRO_APP_ADDR)
|
|
264
268
|
data = {"packageName": package_name, "packageVersion": package_version}
|
|
@@ -268,7 +272,8 @@ def report_brick_next_package(org, brick_targz_path, package_name, package_versi
|
|
|
268
272
|
|
|
269
273
|
|
|
270
274
|
def report_provider_into_contract(org, package_name, contract_content):
|
|
271
|
-
headers =
|
|
275
|
+
headers = get_headers(org)
|
|
276
|
+
|
|
272
277
|
# report contract
|
|
273
278
|
url = "http://{}/api/v1/brick/provider/import_into_contract".format(MICRO_APP_ADDR)
|
|
274
279
|
param = {"packageName": package_name, "data": {
|
|
@@ -5,6 +5,10 @@ import simplejson
|
|
|
5
5
|
import requests
|
|
6
6
|
import ens_api
|
|
7
7
|
|
|
8
|
+
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
|
9
|
+
from utils.get_headers import get_headers
|
|
10
|
+
|
|
11
|
+
|
|
8
12
|
def collect(install_path):
|
|
9
13
|
if not os.path.exists(install_path):
|
|
10
14
|
raise Exception("could not find install path {}".format(install_path))
|
|
@@ -22,7 +26,7 @@ def create_or_update_theme_template_data(data, org):
|
|
|
22
26
|
if session_id <= 0:
|
|
23
27
|
raise Exception("get nameservice logic.micro_app_service error, session_id={}".format(session_id))
|
|
24
28
|
address = "{}:{}".format(ip, port)
|
|
25
|
-
headers =
|
|
29
|
+
headers = get_headers(org)
|
|
26
30
|
url = "http://{}/api/v1/next-builder/theme-data-import".format(address)
|
|
27
31
|
param = {"themeData": data}
|
|
28
32
|
rsp = requests.post(url, json=param, headers=headers)
|
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
import os
|
|
5
|
+
|
|
6
|
+
TOOLS_DIR = "/usr/local/easyops/deploy_init/tools"
|
|
7
|
+
sys.path.append(TOOLS_DIR)
|
|
8
|
+
get_token = None
|
|
9
|
+
token_util_path = os.path.join(TOOLS_DIR, "get_token_util.py")
|
|
10
|
+
if os.path.exists(token_util_path):
|
|
11
|
+
from get_token_util import get_token
|
|
12
|
+
|
|
13
|
+
APP_ID = "brick_next"
|
|
14
|
+
DEFAULT_USER = "defaultUser"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def get_headers(org, user=DEFAULT_USER):
|
|
18
|
+
headers = {"org": str(org), "user": user}
|
|
19
|
+
if get_token is None:
|
|
20
|
+
return headers
|
|
21
|
+
|
|
22
|
+
token = get_token(user=user, org=int(org), app_id=APP_ID)
|
|
23
|
+
if not token:
|
|
24
|
+
return headers
|
|
25
|
+
|
|
26
|
+
headers["Authorization"] = "Bearer {}".format(token)
|
|
27
|
+
return headers
|