Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

artifacts插件管理所有部署物料包相关内容,移除CMDB模型依赖 #270

Open
4 tasks
royl88 opened this issue Jan 6, 2021 · 0 comments
Open
4 tasks
Labels
enhancement New feature or request
Milestone

Comments

@royl88
Copy link
Contributor

royl88 commented Jan 6, 2021

描述您的需求
artifacts插件管理所有部署物料包相关内容,包括如下内容:

  • 物料提供以下模型

      部署包   - id, name, ...
      应用差异化变量
      数据库差异化变量
    
  • 单元设计关联 - id, cmdb_unit_design_id, artifacts_path, ...

  • 差异化变量计算(Expression V2待定版)

    Expression V2 相对V1主要改动为:

    1. 新增 @ CONNECTOR 语法
    2. 支持filter value嵌套expression
// EBNF语法如下
single_expr: PACKAGE ":" CI filter* ("." ATTR)?
backref_expr: "(" BACKREF_ATTR ")" PACKAGE ":" CI filter* ("." ATTR)?
expression: single_expr
        | expression FORWARD_REF single_expr
        | expression BACKWARD_REF backref_expr
expression_group: expression // no connector
        | expression_group "@" expression
        | expression_group "@" CONNECTOR // ends with connector
        | (expression_group "@")? CONNECTOR "@" expression_group // group[optional] connect with group

filter: "{" FILTER_NAME OP filter_value "}"
string_list.2: "[" (STRING_VALUE ("," STRING_VALUE)*)? "]"
number_list: "[" (NUMBER_VALUE ("," NUMBER_VALUE)*)? "]"
filter_value : STRING_VALUE
             | NUMBER_VALUE
             | NULL
             | TRUE
             | FALSE
             | string_list
             | number_list
             | expression_group

PACKAGE: NAME
CI: NAME
ATTR: NAME
BACKREF_ATTR: NAME
FORWARD_REF: /->|>/
BACKWARD_REF: /~|<-/
OP: NAME
FILTER_NAME: NAME ("." NAME)*
_INNER_STRING: /.*?/ /(?<!\\)(\\\\)*?/
STRING_VALUE.2: "'" _INNER_STRING "'"
CONNECTOR: STRING_VALUE
_INT: /\d+/
_FLOAT: _INT "." _INT? | "." _INT
NUMBER_VALUE:  _FLOAT | _INT
NAME: /[a-zA-Z][-_0-9a-zA-Z]*/
NULL: "NULL"
TRUE: "TRUE"
FALSE: "FALSE"
  • 部署包变量替换 & 上传

本次修改主要目的是让CMDB做更适合CMDB应当做的事,由artifacts插件管理所有部署物料相关功能。

@royl88 royl88 added the enhancement New feature or request label Jan 6, 2021
@royl88 royl88 changed the title 项目功能迁移-artifacts插件管理所有部署物料包相关内容,移除CMDB模型依赖 artifacts插件管理所有部署物料包相关内容,移除CMDB模型依赖 Jan 6, 2021
@royl88 royl88 added this to the v2.0.0 milestone Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant