From b2c44ec71e0a8160a6f34bfb652b68fda7ab4f3a Mon Sep 17 00:00:00 2001 From: ysh Date: Mon, 23 Sep 2024 10:33:46 +0900 Subject: [PATCH 1/4] list width update(oss / workflowStage / workflow) --- workflowFE/src/views/oss/OssList.vue | 8 ++++---- workflowFE/src/views/workflow/WorkflowList.vue | 10 +++++----- .../src/views/workflowStage/WorkflowStageList.vue | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/workflowFE/src/views/oss/OssList.vue b/workflowFE/src/views/oss/OssList.vue index 52f34a6..5c43e90 100644 --- a/workflowFE/src/views/oss/OssList.vue +++ b/workflowFE/src/views/oss/OssList.vue @@ -83,21 +83,21 @@ const setColumns = () => { { title: "OSS Name", field: "ossName", - width: 400 + width: '20%' }, { title: "OSS Desc", field: "ossDesc", - width: 500 + width: '20%' }, { title: "URL", field: "ossUrl", - width: 600 + width: '40%' }, { title: "Action", - width: 400, + width: '20%', formatter: editDeleteButtonFormatter, cellClick: function (e, cell) { const target = e.target as HTMLElement; diff --git a/workflowFE/src/views/workflow/WorkflowList.vue b/workflowFE/src/views/workflow/WorkflowList.vue index c4b2f1d..569c6b1 100644 --- a/workflowFE/src/views/workflow/WorkflowList.vue +++ b/workflowFE/src/views/workflow/WorkflowList.vue @@ -63,28 +63,28 @@ const setColumns = () => { { title: "Workflow Name", field: "workflowInfo.workflowName", - width: 500 + width: '35%' }, { title: "Workflow Purpose", field: "workflowInfo.workflowPurpose", - width: 200 + width: '10%' }, { title: "Params Count", formatter: paramsCountFomatter, - width: 400, + width: '10%', // widthShrink: 1, }, { title: "Created Date", field: "regDate", - width: 400, + width: '20%', // widthShrink: 5, }, { title: "Action", - width: 400, + width: '25%', formatter: editButtonFormatter, cellClick: async(e, cell) => { const target = e.target as HTMLElement; diff --git a/workflowFE/src/views/workflowStage/WorkflowStageList.vue b/workflowFE/src/views/workflowStage/WorkflowStageList.vue index ed9f01f..dfc9a43 100644 --- a/workflowFE/src/views/workflowStage/WorkflowStageList.vue +++ b/workflowFE/src/views/workflowStage/WorkflowStageList.vue @@ -84,21 +84,21 @@ const setColumns = () => { { title: "Stage Type", field: "workflowStageTypeName", - width: 500 + width: '27%' }, { title: "Stage Name", field: "workflowStageName", - width: 500 + width: '27%' }, { title: "Stage Desc", field: "workflowStageDesc", - width: 500 + width: '26%' }, { title: "Action", - width: 400, + width: '20%', formatter: editDeleteButtonFormatter, cellClick: function (e, cell) { const target = e.target as HTMLElement; From 3ac07c987082b9327b107f390460d6dad9280072 Mon Sep 17 00:00:00 2001 From: ysh Date: Mon, 23 Sep 2024 10:34:13 +0900 Subject: [PATCH 2/4] UI build file update --- WIKI.md | 2 +- ...ListenerList-DcWsneEB.js => EventListenerList-dh9SUGyU.js} | 2 +- .../assets/{OssList-CSNofrF6.js => OssList-DdBUFwYX.js} | 2 +- .../assets/{ParamForm-Cfno5gBf.js => ParamForm-DWXgfyBu.js} | 2 +- ... => Tabulator.vue_vue_type_style_index_0_lang-D7_tsGwS.js} | 2 +- .../{WorkflowForm-4Y0H_Mdp.js => WorkflowForm-BIH4a4aC.js} | 2 +- .../{WorkflowList-Dey5b8vn.js => WorkflowList-BeO8-nqD.js} | 2 +- ...lowStageList-C0cDBmdj.js => WorkflowStageList-CDWEfeEn.js} | 2 +- .../static/assets/{index-Ds2DFCP7.js => index-6aZxCmbx.js} | 4 ++-- .../static/assets/{oss-B07LWDQX.js => oss-BY1ImqvI.js} | 2 +- .../assets/{request-qwmp2ebq.js => request-CKqEXO02.js} | 2 +- src/main/resources/static/index.html | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) rename src/main/resources/static/assets/{EventListenerList-DcWsneEB.js => EventListenerList-dh9SUGyU.js} (97%) rename src/main/resources/static/assets/{OssList-CSNofrF6.js => OssList-DdBUFwYX.js} (91%) rename src/main/resources/static/assets/{ParamForm-Cfno5gBf.js => ParamForm-DWXgfyBu.js} (96%) rename src/main/resources/static/assets/{Tabulator.vue_vue_type_style_index_0_lang-B1UtuJWR.js => Tabulator.vue_vue_type_style_index_0_lang-D7_tsGwS.js} (99%) rename src/main/resources/static/assets/{WorkflowForm-4Y0H_Mdp.js => WorkflowForm-BIH4a4aC.js} (99%) rename src/main/resources/static/assets/{WorkflowList-Dey5b8vn.js => WorkflowList-BeO8-nqD.js} (85%) rename src/main/resources/static/assets/{WorkflowStageList-C0cDBmdj.js => WorkflowStageList-CDWEfeEn.js} (93%) rename src/main/resources/static/assets/{index-Ds2DFCP7.js => index-6aZxCmbx.js} (99%) rename src/main/resources/static/assets/{oss-B07LWDQX.js => oss-BY1ImqvI.js} (89%) rename src/main/resources/static/assets/{request-qwmp2ebq.js => request-CKqEXO02.js} (87%) diff --git a/WIKI.md b/WIKI.md index 5d25c9a..168b24f 100644 --- a/WIKI.md +++ b/WIKI.md @@ -1 +1 @@ -# M-CMP mc-workflow-manager Wiki This repository provides a Workflow Manager. A sub-system of [M-CMP platform](https://github.com/m-cmp/docs/tree/main) to deploy and manage Multi-Cloud Infrastructures.
## 1. Overview M-CMP의 mc-workflow-manager 서브시스템이 제공하는 기능은 다음과 같다. - ToolChain 관리 - Workflow Stage 관리 - Workflow 관리 - Software Catalog 관리
## 2. Flow ### 2-1. Workflow Manager Flow M-CMP의 mc-workflow-manager 서브시스템의 Flow는 다음과 같다. 1. ToolChain 등록 (연동될 OSS 정보들응 등록) - 연동되어 사용될 Jenkins, Gitlab, ArgoCD, Nexus, Tumblebug 등 - Workflow 용 OSS인 Jenkins는 Workflow 관련 기능을 위해 필수로 등록한다. 2. Workflow Stage 등록 (Workflow를 구성할 Stage 등록) - 템플릿 개념의 Stage 등록 후 Workflow에서 사용 가능하다. - 필수로 등록 하지 않아도 된다. 3. Workflow 생성 - 등록된 Stage등을 조합/직접 입력 하여 Workflow를 생성한다. 4. Workflow 실행 - UI 또는 API 를 활용하여 Workflow를 실행한다. ### 2-2. Software Catalog Flow 1. Software Catalog 등록

2. 연관 Workflow 및 관련 Catalog 등록 - software catalog 연계 workflow 및 catalog 등록(optional) - 해당software 설치 workflow 실행, 재시작 등 연관 workflow 등록 - 연관catalog 등록 3. Software Catalog 확인 및 타 Repository 검색

4. 연관workflow 실행 등 - 연관workflow 실행, 또는 연관 catalog 정보 확인 등 - 해당software 설치 workflow 실행 등 등록된 연관 workflow 사용 - 검색된외부sw를catalog에 등록 등
## 3. 기능 API ### 3-1. ToolChain
API | Function | API | EndPoint | Parameter | DESC | |:------------------------------------------------------|:-------|:-----------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------| | ToolChain List
(툴체인 목록) | GET | /config/oss/list | | 툴체인 목록을 조회한다.
연동사용OSS(nexus, jenkins 등)을 위한 정보를 입력 및 조회
db등의 정보이외에는직접등록후사용한다. | | ToolChain Duplication Check
(툴체인 중복 체크) | GET | /config/oss/duplicate | (QueryParam)
ossName=tumblebug&
ossUrl=http:%2F%2Ftb.tb-cb.kro.kr:1323&
ossUsername=default | 등록될 툴체인 명 중복 검사를한다. | | ToolChain Connection Check
(툴체인 커넥션 체크) | POST | /config/oss/connection/check | (Request Body)
{
"ossCd":"TUMBLEBUG",
"ossName":"tumblebug",
"ossDesc":"",
"ossUrl":"http://tb.tb-cb.kro.kr:1323",
"ossUsername":"default",
"ossPassword":"default",
"ossToken":"“
} | 등록될 툴체인의ID / PW로 연결확인을한다. | | ToolChain Regist
(툴체인 등록) | POST | /config/oss | (Request Body)
{
"ossCd":"TUMBLEBUG",
"ossName":"tumblebug",
"ossDesc":"",
"ossUrl":"http://tb.tb-cb.kro.kr:1323",
"ossUsername":"default",
"ossPassword":"ZGVmYXVsdA==",
"ossToken":""
} | 툴체인을 등록한다. |

### 3-2. Workflow Stage
API | Function | API | EndPoint | Parameter | DESC | |:--------------------------------------------------------------------|:------|:-------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------| | Workflow Stage List
(워크플로우 스테이지 목록) | GET | /stage/pipeline/list | - | 젠킨스 스테이지 목록을 조회한다.
젠킨스 스테이지를 조합한 jenkins job (workflow) 구성을 위한 스테이지 목록 | | Workflow StageCD Add
(스테이지 구분 추가) | POST | /common/group/Pipeline/code | (Request Body)
{
"commonGroupCd":"Pipeline",
"commonCd":"TUMBLEBUG",
"codeName":"TUMBLEBUG",
"codeDesc":"Add StageCd",
"codeOrder":13
} | 스테이지 구분을 추가한다.
(여러 스테이지를 관리 할 상위 depth 개념) | | Workflow Stage Name Duplicate
(워크플로우 스테이지 이름 중복 체크) | GET | /stage/pipeline/name/duplicate | (Query Param)
pipelineCd={스테이지구분}&
pipelineName={스테이지명} | 스테이지 구분에 종속된 스테이지명 중복검사를 한다. | | Workflow Stage Regist (워크플로우 스테이지 등록) | POST | /stage/pipeline | (Request Body)
{
"pipelineCd":"TUMBLEBUG",
"pipelineName":"tumblebug-Test",
"pipelineScript":"
stage('tumblebug') {\n TUMBLEBUG'\n \n steps {\n echo '>>>>>STAGE: // 스크립트를작성해주세요.\n }\n }\n \n",
"newStageCd":"tumblebug“
} | 스테이지를등록한다. |

### 3-3. Workflow
API | Function | API | EndPoint | Parameter | DESC | |:---------------------------------------------------------|:--------------|:-----------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------| | Workflow List
(워크플로우 목록) | GET | /workflow/list | - | 워크플로우 목록을 조회한다.
스테이지를 조합하여 구성한 workflow 목록을 조회 | | Workflow Name Duplicate
(워크플로우 이름 중복 체크) | GET | /workflow/name/duplicate | (Query Param)
workflowName=workflow-test | 등록될 워크플로우 명을 중복검사 한다. | | Workflow Default Script Create
(워크플로우 기본 스크립트 생성) | POST | /workflow/jenkins/pipeline/default | (Request Body)
{
"pipelineParam":[{"paramKey":"","paramValue":""}],
"workflowName":"workflow-test",
"workflowPurpose":"test",
"jenkinsId":2
} | 기본 스크립트를 생성한다. | | Workflow Regist
(워크플로우 생성) | POST | /workflow | (Request Body) ​
{​
"workflowName": "workflow-test",​
"workflowPurpose": "test",​
"jenkinsId": 2,​
"pipelineParam": [​
{​
"paramKey": "MCIS_NAME",​
"paramValue": "vm_name"​
}​
],
​"pipelineScript": "//It was created by the Devops portal.\npipeline {\n agent any\n \n environment {\n MC_SPIDER_REST_URI = http://tb.tb-cb.kro.kr:1323\n CB_TUMBLEBUG_SWAGGER_URI = http://tb.tb-cb.kro.kr:1323/tumblebug/api/index.html\n }\n \n stages {\n\n stage('tumblebug') {\n steps {\n echo '>>>>>STAGE: TUMBLEBUG'\n \n // 스크립트를 작성해주세요.\n echo 'MCIS NAME >> ' \"${MCIS_NAME}\"\n }\n }\n \n\n }\n}\n“",​
"pipelines": [​
{​
"pipelineScript": "//It was created by the Devops portal.\npipeline {\n agent any\n \n environment {\n MC_SPIDER_REST_URI = http://tb.tb-cb.kro.kr:1323\n CB_TUMBLEBUG_SWAGGER_URI = http://tb.tb-cb.kro.kr:1323/tumblebug/api/index.html\n }\n \n stages {\n",
​ "pipelineOrder": 0,​
"isDefaultScript": true,​
"defaultScriptTag": "DEFAULT_START"​
},​
{​
"pipelineScript": " stage('tumblebug') {\n steps {\n echo '>>>>>STAGE: TUMBLEBUG'\n \n // 스크립트를 작성해주세요.\n echo 'MCIS NAME >> ' \"${MCIS_NAME}\"\n }\n }\n \n",​
"pipelineOrder": 1​
},​
{​
"pipelineScript": " }\n}\n",​
"pipelineOrder": 2,​
"isDefaultScript": true,​
"defaultScriptTag": "DEFAULT_END"​
}​
]​
}​ | 워크플로우 생성과 함께 Jenkins Job이 생성된다 | | Workflow Run
(워크플로우 실행) | POST
GET |/workflow/run
/workflow/{workflowIdx}/run|(Request Body)​
{​
"workflowId":47, "​pipelineParam": [​
{​
"paramKey":"MCIS_NAME",​
"paramValue":"test",​
}
],​
}​| 등록된 워크플로우를 실행 한다. |
워크플로우 실행 추가 설명 * 등록된 workflow에 따라 실행 시 추가로 필요한 데이터가 존재할 수 있음(param)
GET방식 실행 시 설정된 value 기본값으로 실행
Ex) tomcat 9.0 설치 workflow
- MCIS, NAMESPACE 등 필요
- 개발서버기준 vm 삭제
API : (POST) /workflow/run
Param : (Request Body)
```JSON { "workflowId":47, "pipelineParam": [ { "paramKey":"MCIS", "paramValue":"{mcisname}" }, { "paramKey":"NAMESPACE", "paramValue":"{namespace}" } ] } ``` Ex2) 현재시간 반환 workflow, health check 등 - 단순실행(GET) 가능

### 3-4. Software Catalog
API | Function | API | EndPoint | Parameter | DESC | |:----------------------------------------------------|:-------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------| | Software Catalog Regist
(Software Catalog 등록) | POST | /catalog/software/ | (Request Body)(Request Body)
{
​ "scTitle": "test api call dummy",​
"scVersion": "0.0.0",​
"scIcon": "https://avatars.githubusercontent.com/u/133619646?s=48&v=4",
"scSummary": "test for swCatalog insert \n aabbccdd",​
"scUrl": ".",​
"scCategory": "CORE",​
"scReference": "https://github.com/cloud-barista/cb-tumblebug",
"scDescription": "test dummy data insert"​
}​ | 새로 생성할 software정보를 입력(임시 api, 정책 비확정으로 현재 기본정보정도만 구현한 임시 api) | | Software Catalog 연관 workflow/catalog 등록 | 1. GET
2. GET | 1. /catalog/software/relation/workflow/{생성된 catalogIdx}/{연결할 workflowIdx}​
2. /catalog/software/relation/workflow/{입력 성공 시 반환된 data.scIdx)}/61(vm infra create)​ | - | 생성된 software catalog에 연동할 workflow를 입력​ | | Software Catalog List
(Software Catalog 목록) | GET | /catalog/software/{searchKeyword} | - | {searchKeyword}값이 없으면 전체조회​ | | dockerHub image Detail
(dockerHub image 조회) | GET | /applications/search/dockerhub/catalog/{searchKeyword} | - | dockerHub image 조회 | | artifactHub helm Detail
(artifactHub helm 조회) | GET | /applications/search/artifactHub/package/{searchKeyword}​ | - | artifactHub helm 조회 | | Workflow Run
(workflow 실행) | POST | /workflow/run​ | {​
"workflowId": 61,​
"pipelineParam": [​
{"paramKey": "NAMESPACE", "paramValue": "ns01"},​
{"paramKey": "MCIS", "paramValue": "test-vm-0621-001"},​
{"paramKey": "SUBGROUP_SIZE", "paramValue": "1"},​
{"paramKey": "SPEC", "paramValue": "aws+ap-northeast-2+t2.small"}​
]​
} | workflow 실행 | | Workflow Run
(생성된 vm infra 삭제 workflow) | POST | /workflow/run | {
"workflowId": 49,​
"pipelineParam": [​
{"paramKey": "NAMESPACE", "paramValue": "ns01"},​
{"paramKey": "MCIS", "paramValue": "test-vm-0621-001"}​
]​
}​ | 생성된 vm infra 삭제 workflow |

\ No newline at end of file +# M-CMP mc-workflow-manager Wiki **MC-Workflow-Manager** is one of the components of the [M-CMP](https://github.com/m-cmp/docs/tree/main) platform. With **MC-Workflow-Manager**, you can easily create and execute workflows, as well as modify and delete them as needed. For example, it allows you to create and manage multi-cloud infrastructures and seamlessly deploy applications across multiple clouds. --- ## 1. Overview The **mc-workflow-manager** subsystem of **M-CMP** provides the following functions - ToolChain management - Workflow Stage management - Workflow management - Event Listener management --- ## 2. Flow ### 2-1. Workflow Manager Flow M-CMP의 mc-workflow-manager 서브시스템의 Flow는 다음과 같다. 1. ToolChain 등록 (연동될 OSS 정보들응 등록) - 연동되어 사용될 Jenkins, Gitlab, ArgoCD, Nexus, Tumblebug 등 - Workflow 용 OSS인 Jenkins는 Workflow 관련 기능을 위해 필수로 등록한다. 2. Workflow Stage 등록 (Workflow를 구성할 Stage 등록) - 템플릿 개념의 Stage 등록 후 Workflow에서 사용 가능하다. - 필수로 등록 하지 않아도 된다. 3. Workflow 생성 - 등록된 Stage등을 조합/직접 입력 하여 Workflow를 생성한다. 4. Workflow 실행 - UI 또는 API 를 활용하여 Workflow를 실행한다. [//]: # () [//]: # (※ Event Listener) [//]: # ( - 호출받은 ) ## 3. 기능 API ### 3-1. ToolChain
API | Function | API | EndPoint | Parameter | DESC | |:------------------------------------------------------|:-------|:-----------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------| | ToolChain List
(툴체인 목록) | GET | /config/oss/list | | 툴체인 목록을 조회한다.
연동사용OSS(nexus, jenkins 등)을 위한 정보를 입력 및 조회
db등의 정보이외에는직접등록후사용한다. | | ToolChain Duplication Check
(툴체인 중복 체크) | GET | /config/oss/duplicate | (QueryParam)
ossName=tumblebug&
ossUrl=http:%2F%2Ftb.tb-cb.kro.kr:1323&
ossUsername=default | 등록될 툴체인 명 중복 검사를한다. | | ToolChain Connection Check
(툴체인 커넥션 체크) | POST | /config/oss/connection/check | (Request Body)
{
"ossCd":"TUMBLEBUG",
"ossName":"tumblebug",
"ossDesc":"",
"ossUrl":"http://tb.tb-cb.kro.kr:1323",
"ossUsername":"default",
"ossPassword":"default",
"ossToken":"“
} | 등록될 툴체인의ID / PW로 연결확인을한다. | | ToolChain Regist
(툴체인 등록) | POST | /config/oss | (Request Body)
{
"ossCd":"TUMBLEBUG",
"ossName":"tumblebug",
"ossDesc":"",
"ossUrl":"http://tb.tb-cb.kro.kr:1323",
"ossUsername":"default",
"ossPassword":"ZGVmYXVsdA==",
"ossToken":""
} | 툴체인을 등록한다. |

### 3-2. Workflow Stage
API | Function | API | EndPoint | Parameter | DESC | |:--------------------------------------------------------------------|:------|:-------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------| | Workflow Stage List
(워크플로우 스테이지 목록) | GET | /stage/pipeline/list | - | 젠킨스 스테이지 목록을 조회한다.
젠킨스 스테이지를 조합한 jenkins job (workflow) 구성을 위한 스테이지 목록 | | Workflow StageCD Add
(스테이지 구분 추가) | POST | /common/group/Pipeline/code | (Request Body)
{
"commonGroupCd":"Pipeline",
"commonCd":"TUMBLEBUG",
"codeName":"TUMBLEBUG",
"codeDesc":"Add StageCd",
"codeOrder":13
} | 스테이지 구분을 추가한다.
(여러 스테이지를 관리 할 상위 depth 개념) | | Workflow Stage Name Duplicate
(워크플로우 스테이지 이름 중복 체크) | GET | /stage/pipeline/name/duplicate | (Query Param)
pipelineCd={스테이지구분}&
pipelineName={스테이지명} | 스테이지 구분에 종속된 스테이지명 중복검사를 한다. | | Workflow Stage Regist (워크플로우 스테이지 등록) | POST | /stage/pipeline | (Request Body)
{
"pipelineCd":"TUMBLEBUG",
"pipelineName":"tumblebug-Test",
"pipelineScript":"
stage('tumblebug') {\n TUMBLEBUG'\n \n steps {\n echo '>>>>>STAGE: // 스크립트를작성해주세요.\n }\n }\n \n",
"newStageCd":"tumblebug“
} | 스테이지를등록한다. |

### 3-3. Workflow
API | Function | API | EndPoint | Parameter | DESC | |:---------------------------------------------------------|:--------------|:-----------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:----------------------------------------------------| | Workflow List
(워크플로우 목록) | GET | /workflow/list | - | 워크플로우 목록을 조회한다.
스테이지를 조합하여 구성한 workflow 목록을 조회 | | Workflow Name Duplicate
(워크플로우 이름 중복 체크) | GET | /workflow/name/duplicate | (Query Param)
workflowName=workflow-test | 등록될 워크플로우 명을 중복검사 한다. | | Workflow Default Script Create
(워크플로우 기본 스크립트 생성) | POST | /workflow/jenkins/pipeline/default | (Request Body)
{
"pipelineParam":[{"paramKey":"","paramValue":""}],
"workflowName":"workflow-test",
"workflowPurpose":"test",
"jenkinsId":2
} | 기본 스크립트를 생성한다. | | Workflow Regist
(워크플로우 생성) | POST | /workflow | (Request Body) ​
{​
"workflowName": "workflow-test",​
"workflowPurpose": "test",​
"jenkinsId": 2,​
"pipelineParam": [​
{​
"paramKey": "MCIS_NAME",​
"paramValue": "vm_name"​
}​
],
​"pipelineScript": "//It was created by the Devops portal.\npipeline {\n agent any\n \n environment {\n MC_SPIDER_REST_URI = http://tb.tb-cb.kro.kr:1323\n CB_TUMBLEBUG_SWAGGER_URI = http://tb.tb-cb.kro.kr:1323/tumblebug/api/index.html\n }\n \n stages {\n\n stage('tumblebug') {\n steps {\n echo '>>>>>STAGE: TUMBLEBUG'\n \n // 스크립트를 작성해주세요.\n echo 'MCIS NAME >> ' \"${MCIS_NAME}\"\n }\n }\n \n\n }\n}\n“",​
"pipelines": [​
{​
"pipelineScript": "//It was created by the Devops portal.\npipeline {\n agent any\n \n environment {\n MC_SPIDER_REST_URI = http://tb.tb-cb.kro.kr:1323\n CB_TUMBLEBUG_SWAGGER_URI = http://tb.tb-cb.kro.kr:1323/tumblebug/api/index.html\n }\n \n stages {\n",
​ "pipelineOrder": 0,​
"isDefaultScript": true,​
"defaultScriptTag": "DEFAULT_START"​
},​
{​
"pipelineScript": " stage('tumblebug') {\n steps {\n echo '>>>>>STAGE: TUMBLEBUG'\n \n // 스크립트를 작성해주세요.\n echo 'MCIS NAME >> ' \"${MCIS_NAME}\"\n }\n }\n \n",​
"pipelineOrder": 1​
},​
{​
"pipelineScript": " }\n}\n",​
"pipelineOrder": 2,​
"isDefaultScript": true,​
"defaultScriptTag": "DEFAULT_END"​
}​
]​
}​ | 워크플로우 생성과 함께 Jenkins Job이 생성된다 | | Workflow Run
(워크플로우 실행) | POST
GET |/workflow/run
/workflow/{workflowIdx}/run|(Request Body)​
{​
"workflowId":47, "​pipelineParam": [​
{​
"paramKey":"MCIS_NAME",​
"paramValue":"test",​
}
],​
}​| 등록된 워크플로우를 실행 한다. |
워크플로우 실행 추가 설명 * 등록된 workflow에 따라 실행 시 추가로 필요한 데이터가 존재할 수 있음(param)
GET방식 실행 시 설정된 value 기본값으로 실행
Ex) tomcat 9.0 설치 workflow
- MCIS, NAMESPACE 등 필요
- 개발서버기준 vm 삭제
API : (POST) /workflow/run
Param : (Request Body)
```JSON { "workflowId":47, "pipelineParam": [ { "paramKey":"MCIS", "paramValue":"{mcisname}" }, { "paramKey":"NAMESPACE", "paramValue":"{namespace}" } ] } ``` Ex2) 현재시간 반환 workflow, health check 등 - 단순실행(GET) 가능

\ No newline at end of file diff --git a/src/main/resources/static/assets/EventListenerList-DcWsneEB.js b/src/main/resources/static/assets/EventListenerList-dh9SUGyU.js similarity index 97% rename from src/main/resources/static/assets/EventListenerList-DcWsneEB.js rename to src/main/resources/static/assets/EventListenerList-dh9SUGyU.js index 2153785..153183b 100644 --- a/src/main/resources/static/assets/EventListenerList-DcWsneEB.js +++ b/src/main/resources/static/assets/EventListenerList-dh9SUGyU.js @@ -1,4 +1,4 @@ -import{_ as B,a as V}from"./Tabulator.vue_vue_type_style_index_0_lang-B1UtuJWR.js";import{s as _}from"./request-qwmp2ebq.js";import{d as $,u as C,c as W,w as S,o as D,r as v,a as b,b as e,t as E,e as N,g as I,v as M,F as q,f as A,k as R,j as Y,h as m,i as y}from"./index-Ds2DFCP7.js";import{g as G,P as T}from"./ParamForm-Cfno5gBf.js";const j=()=>_.get("/eventlistener/list");function z(s){return _.get("/eventlistener/"+s)}function H(s){return _.get(`/eventlistener/duplicate?eventlistenerName=${s}`)}function J(s){return _.post("/eventlistener",s)}function K(s){return _.patch(`/eventlistener/${s.eventListenerIdx}`,s)}function O(s){return _.delete(`/eventlistener/${s}`)}const Q={class:"modal",id:"eventListenerForm",tabindex:"-1"},X={class:"modal-dialog modal-lg",role:"document"},Z={class:"modal-content"},ee=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1),te={class:"modal-body text-left py-4"},se={class:"mb-5"},ne={class:"row mb-3"},ae=e("label",{class:"form-label required"},"Event Listener 명",-1),oe={class:"grid gap-0 column-gap-3"},le={key:1,class:"btn btn-success",style:{margin:"3px"}},ie={class:"mb-3"},re=e("label",{class:"form-label required"},"Event Listener 설명",-1),ce={class:"mb-3"},de=e("label",{class:"form-label required"},"Workflow",-1),ve=e("option",{value:0},"Select Workflow",-1),ue=["value"],me={class:"modal-footer"},fe=$({__name:"eventListenerForm",props:{mode:{},eventListenerIdx:{}},emits:["get-event-listener-list"],setup(s,{emit:p}){const o=C(),l=s,u=p,g=W(()=>l.eventListenerIdx);S(g,async()=>{await f(),await L()}),D(async()=>{await f(),await L()});const t=v({}),c=v(!1),f=async()=>{if(l.mode==="new")t.value.eventListenerName="",t.value.eventListenerDesc="",t.value.workflowIdx=0,t.value.workflowParams=[],w.value=!1,c.value=!0;else{const{data:n}=await z(l.eventListenerIdx);t.value=n,w.value=!0,c.value=!0}},k=v([]),L=async()=>{const{data:n}=await G("N");k.value=n},w=v(!1),r=async()=>{const{data:n}=await H(t.value.eventListenerName);n?o.error("이미 사용중인 이름입니다."):(o.success("사용 가능한 이름입니다."),w.value=!0)},d=async()=>{l.mode==="new"?(t.value.workflowParams.forEach(n=>{n.paramIdx=0,n.eventListenerYn="Y"}),await h().then(()=>{u("get-event-listener-list")})):await x().then(()=>{u("get-event-listener-list")}),f()},h=async()=>{const{data:n}=await J(t.value);n?o.success("등록되었습니다."):o.error("등록 할 수 없습니다.")},x=async()=>{const{data:n}=await K(t.value);n?o.success("등록되었습니다."):o.error("등록 할 수 없습니다.")},F=()=>{w.value=!1},U=n=>{k.value.forEach(a=>{a.workflowInfo.workflowIdx===n&&(t.value.workflowParams=a.workflowParams)})};return(n,a)=>(m(),b("div",Q,[e("div",X,[e("div",Z,[ee,e("div",te,[e("h3",se," Event Listener "+E(l.mode==="new"?"생성":"수정"),1),e("div",null,[e("div",ne,[ae,e("div",oe,[N(e("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Event Listener 명을 입력하세요","onUpdate:modelValue":a[0]||(a[0]=i=>t.value.eventListenerName=i),onFocus:F},null,544),[[I,t.value.eventListenerName]]),w.value?(m(),b("button",le,"중복 체크")):(m(),b("button",{key:0,class:"btn btn-primary chk",onClick:r,style:{margin:"3px"}},"중복 체크"))])]),e("div",ie,[re,N(e("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Event Listener 설명을 입력하세요","onUpdate:modelValue":a[1]||(a[1]=i=>t.value.eventListenerDesc=i)},null,512),[[I,t.value.eventListenerDesc]])]),e("div",ce,[de,N(e("select",{class:"form-select p-2 g-col-12","onUpdate:modelValue":a[2]||(a[2]=i=>t.value.workflowIdx=i),onChange:a[3]||(a[3]=i=>U(t.value.workflowIdx))},[ve,(m(!0),b(q,null,A(k.value,(i,P)=>(m(),b("option",{value:i.workflowInfo.workflowIdx,key:P},E(i.workflowInfo.workflowName),9,ue))),128))],544),[[M,t.value.workflowIdx]])]),c.value?(m(),R(T,{key:0,popup:!1,"workflow-param-data":t.value.workflowParams,"event-listener-yn":"Y",style:{margin:"0 !important"}},null,8,["workflow-param-data"])):Y("",!0)])]),e("div",me,[e("a",{href:"#",class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:a[4]||(a[4]=i=>f())}," Cancel "),e("a",{href:"#",class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:a[5]||(a[5]=i=>d())},E(l.mode==="new"?"생성":"수정"),1)])])])]))}}),we={class:"modal",id:"deleteEventListener",tabindex:"-1"},be={class:"modal-dialog modal-lg",role:"document"},Le={class:"modal-content"},_e=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1),pe=e("div",{class:"modal-status bg-danger"},null,-1),ge={class:"modal-body text-left py-4"},ke=e("h3",{class:"mb-5"}," Event Listener 삭제 ",-1),he={class:"modal-footer"},ye=e("a",{href:"#",class:"btn btn-link link-secondary","data-bs-dismiss":"modal"}," Cancel ",-1),Ee=$({__name:"deleteEventListener",props:{eventListenerName:{},eventListenerIdx:{}},emits:["get-event-listener-list"],setup(s,{emit:p}){const o=C(),l=s,u=p,g=async()=>{const{data:t}=await O(l.eventListenerIdx);t?o.success("삭제되었습니다."):o.error("삭제하지 못했습니다."),u("get-event-listener-list")};return(t,c)=>(m(),b("div",we,[e("div",be,[e("div",Le,[_e,pe,e("div",ge,[ke,e("h4",null,E(l.eventListenerName)+"을(를) 정말 삭제하시겠습니까?",1)]),e("div",he,[ye,e("a",{href:"#",class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:c[0]||(c[0]=f=>g())}," 삭제 ")])])])]))}}),xe={class:"card card-flush w-100"},De=$({__name:"EventListenerList",setup(s){const p=C(),o=v([]),l=v([]);D(async()=>{f(),await u()});const u=async()=>{try{const{data:r}=await j();o.value=r,o.value.forEach(d=>{d.eventListenerUrl=g(d.eventListenerCallUrl)})}catch(r){console.log(r),p.error("데이터를 가져올 수 없습니다.")}},g=r=>window.location.origin+r,t=v(0),c=v(""),f=()=>{l.value=[{title:"Event Listener Name",field:"eventListenerName",width:"20%"},{title:"Connect Workflow Name",field:"workflowName",width:"20%"},{title:"Event Listener Desc",field:"eventListenerDesc",width:"20%"},{title:"Action URL",field:"eventListenerUrl",width:"20%"},{title:"Action",width:"20%",formatter:k,cellClick:function(r,d){const h=r.target,x=h==null?void 0:h.getAttribute("id");t.value=d.getRow().getData().eventListenerIdx,x==="edit-btn"?L.value="edit":c.value=d.getRow().getData().eventListenerName}}]},k=()=>` +import{_ as B,a as V}from"./Tabulator.vue_vue_type_style_index_0_lang-D7_tsGwS.js";import{s as _}from"./request-CKqEXO02.js";import{d as $,u as C,c as W,w as S,o as D,r as v,a as b,b as e,t as E,e as N,g as I,v as M,F as q,f as A,k as R,j as Y,h as m,i as y}from"./index-6aZxCmbx.js";import{g as G,P as T}from"./ParamForm-DWXgfyBu.js";const j=()=>_.get("/eventlistener/list");function z(s){return _.get("/eventlistener/"+s)}function H(s){return _.get(`/eventlistener/duplicate?eventlistenerName=${s}`)}function J(s){return _.post("/eventlistener",s)}function K(s){return _.patch(`/eventlistener/${s.eventListenerIdx}`,s)}function O(s){return _.delete(`/eventlistener/${s}`)}const Q={class:"modal",id:"eventListenerForm",tabindex:"-1"},X={class:"modal-dialog modal-lg",role:"document"},Z={class:"modal-content"},ee=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1),te={class:"modal-body text-left py-4"},se={class:"mb-5"},ne={class:"row mb-3"},ae=e("label",{class:"form-label required"},"Event Listener 명",-1),oe={class:"grid gap-0 column-gap-3"},le={key:1,class:"btn btn-success",style:{margin:"3px"}},ie={class:"mb-3"},re=e("label",{class:"form-label required"},"Event Listener 설명",-1),ce={class:"mb-3"},de=e("label",{class:"form-label required"},"Workflow",-1),ve=e("option",{value:0},"Select Workflow",-1),ue=["value"],me={class:"modal-footer"},fe=$({__name:"eventListenerForm",props:{mode:{},eventListenerIdx:{}},emits:["get-event-listener-list"],setup(s,{emit:p}){const o=C(),l=s,u=p,g=W(()=>l.eventListenerIdx);S(g,async()=>{await f(),await L()}),D(async()=>{await f(),await L()});const t=v({}),c=v(!1),f=async()=>{if(l.mode==="new")t.value.eventListenerName="",t.value.eventListenerDesc="",t.value.workflowIdx=0,t.value.workflowParams=[],w.value=!1,c.value=!0;else{const{data:n}=await z(l.eventListenerIdx);t.value=n,w.value=!0,c.value=!0}},k=v([]),L=async()=>{const{data:n}=await G("N");k.value=n},w=v(!1),r=async()=>{const{data:n}=await H(t.value.eventListenerName);n?o.error("이미 사용중인 이름입니다."):(o.success("사용 가능한 이름입니다."),w.value=!0)},d=async()=>{l.mode==="new"?(t.value.workflowParams.forEach(n=>{n.paramIdx=0,n.eventListenerYn="Y"}),await h().then(()=>{u("get-event-listener-list")})):await x().then(()=>{u("get-event-listener-list")}),f()},h=async()=>{const{data:n}=await J(t.value);n?o.success("등록되었습니다."):o.error("등록 할 수 없습니다.")},x=async()=>{const{data:n}=await K(t.value);n?o.success("등록되었습니다."):o.error("등록 할 수 없습니다.")},F=()=>{w.value=!1},U=n=>{k.value.forEach(a=>{a.workflowInfo.workflowIdx===n&&(t.value.workflowParams=a.workflowParams)})};return(n,a)=>(m(),b("div",Q,[e("div",X,[e("div",Z,[ee,e("div",te,[e("h3",se," Event Listener "+E(l.mode==="new"?"생성":"수정"),1),e("div",null,[e("div",ne,[ae,e("div",oe,[N(e("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Event Listener 명을 입력하세요","onUpdate:modelValue":a[0]||(a[0]=i=>t.value.eventListenerName=i),onFocus:F},null,544),[[I,t.value.eventListenerName]]),w.value?(m(),b("button",le,"중복 체크")):(m(),b("button",{key:0,class:"btn btn-primary chk",onClick:r,style:{margin:"3px"}},"중복 체크"))])]),e("div",ie,[re,N(e("input",{type:"text",class:"form-control p-2 g-col-11",placeholder:"Event Listener 설명을 입력하세요","onUpdate:modelValue":a[1]||(a[1]=i=>t.value.eventListenerDesc=i)},null,512),[[I,t.value.eventListenerDesc]])]),e("div",ce,[de,N(e("select",{class:"form-select p-2 g-col-12","onUpdate:modelValue":a[2]||(a[2]=i=>t.value.workflowIdx=i),onChange:a[3]||(a[3]=i=>U(t.value.workflowIdx))},[ve,(m(!0),b(q,null,A(k.value,(i,P)=>(m(),b("option",{value:i.workflowInfo.workflowIdx,key:P},E(i.workflowInfo.workflowName),9,ue))),128))],544),[[M,t.value.workflowIdx]])]),c.value?(m(),R(T,{key:0,popup:!1,"workflow-param-data":t.value.workflowParams,"event-listener-yn":"Y",style:{margin:"0 !important"}},null,8,["workflow-param-data"])):Y("",!0)])]),e("div",me,[e("a",{href:"#",class:"btn btn-link link-secondary","data-bs-dismiss":"modal",onClick:a[4]||(a[4]=i=>f())}," Cancel "),e("a",{href:"#",class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:a[5]||(a[5]=i=>d())},E(l.mode==="new"?"생성":"수정"),1)])])])]))}}),we={class:"modal",id:"deleteEventListener",tabindex:"-1"},be={class:"modal-dialog modal-lg",role:"document"},Le={class:"modal-content"},_e=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1),pe=e("div",{class:"modal-status bg-danger"},null,-1),ge={class:"modal-body text-left py-4"},ke=e("h3",{class:"mb-5"}," Event Listener 삭제 ",-1),he={class:"modal-footer"},ye=e("a",{href:"#",class:"btn btn-link link-secondary","data-bs-dismiss":"modal"}," Cancel ",-1),Ee=$({__name:"deleteEventListener",props:{eventListenerName:{},eventListenerIdx:{}},emits:["get-event-listener-list"],setup(s,{emit:p}){const o=C(),l=s,u=p,g=async()=>{const{data:t}=await O(l.eventListenerIdx);t?o.success("삭제되었습니다."):o.error("삭제하지 못했습니다."),u("get-event-listener-list")};return(t,c)=>(m(),b("div",we,[e("div",be,[e("div",Le,[_e,pe,e("div",ge,[ke,e("h4",null,E(l.eventListenerName)+"을(를) 정말 삭제하시겠습니까?",1)]),e("div",he,[ye,e("a",{href:"#",class:"btn btn-primary ms-auto","data-bs-dismiss":"modal",onClick:c[0]||(c[0]=f=>g())}," 삭제 ")])])])]))}}),xe={class:"card card-flush w-100"},De=$({__name:"EventListenerList",setup(s){const p=C(),o=v([]),l=v([]);D(async()=>{f(),await u()});const u=async()=>{try{const{data:r}=await j();o.value=r,o.value.forEach(d=>{d.eventListenerUrl=g(d.eventListenerCallUrl)})}catch(r){console.log(r),p.error("데이터를 가져올 수 없습니다.")}},g=r=>window.location.origin+r,t=v(0),c=v(""),f=()=>{l.value=[{title:"Event Listener Name",field:"eventListenerName",width:"20%"},{title:"Connect Workflow Name",field:"workflowName",width:"20%"},{title:"Event Listener Desc",field:"eventListenerDesc",width:"20%"},{title:"Action URL",field:"eventListenerUrl",width:"20%"},{title:"Action",width:"20%",formatter:k,cellClick:function(r,d){const h=r.target,x=h==null?void 0:h.getAttribute("id");t.value=d.getRow().getData().eventListenerIdx,x==="edit-btn"?L.value="edit":c.value=d.getRow().getData().eventListenerName}}]},k=()=>`