diff --git a/README.md b/README.md index cccd768b..d1e0b71e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## orion-ops 是什么 -`orion-ops` 一站式自动化运维及自动化部署平台, 无 Agent 的方式接入应用, 使用多环境的概念, 提供了机器管理、WebTerminal、 WebSftp、 机器批量执行、日志在线查看、定时调度任务、应用环境维护、应用构建及发布任务 (CI / CD) 等功能, 帮助开发人员快速定位问题, +`orion-ops` 一站式自动化运维及自动化部署平台, 无 Agent 的方式接入应用, 使用多环境的概念, 提供了机器管理、WebTerminal、 WebSftp、 机器批量执行、日志在线查看、定时调度任务、应用环境维护、应用构建及发布任务 (CI / CD)、操作流水线等功能, 帮助开发人员快速定位问题, 致力于企业级应用。 Github: https://github.com/lijiahangmax/orion-ops @@ -48,7 +48,7 @@ Demo: http://101.43.254.243/ops/#/ > 机器列表 -![机器列表](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-03-14/files8512578085516682386.png "机器列表") +![机器列表](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-04-25/files1264467313405831364.png "机器列表") > 在线终端 @@ -61,7 +61,7 @@ Demo: http://101.43.254.243/ops/#/ > 批量执行 -![批量执行](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-03-14/files8195883496604225112.png "批量执行") +![批量执行](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-04-25/files4899857856529374903.png "批量执行") > 日志文件 @@ -69,39 +69,46 @@ Demo: http://101.43.254.243/ops/#/ > 调度任务 -![调度任务](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-03-14/files7140183316009047038.png "调度任务") -![调度执行列表](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-03-14/files5875226043882871962.png "调度执行列表") -![调度执行日志](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-03-14/files285645083754039026.png "调度执行日志") +![调度任务](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-04-25/files5065881246088616914.png "调度任务") +![调度执行列表](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-04-25/files9138174215052119985.png "调度执行列表") +![调度执行日志](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-04-25/files3786363821214889886.png "调度执行日志") > 应用配置 -![应用列表](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-03-14/files3132678810569551460.png "应用列表") -![构建配置](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-03-14/files8930817600030460.png "构建配置") -![发布配置](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-03-14/files4557512125504191404.png "发布配置") +![应用列表](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-04-25/files2712336456731415928.png "应用列表") +![构建配置](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-04-25/files7988531022696126381.png "构建配置") +![发布配置](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-04-25/files1800464505453752748.png "发布配置") > 构建列表 -![构建列表](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-03-14/files4960287647322644132.png "构建列表") -![构建日志](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-03-14/files6245253907567338465.png "构建日志") +![构建列表](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-04-25/files2590331112837583257.png "构建列表") +![构建日志](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-04-25/files4232688502598769434.png "构建日志") > 发布列表 -![发布列表](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-03-14/files4322661961526641390.png "发布列表") -![发布日志](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-03-14/files4699926352889499394.png "发布日志") +![发布列表](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-04-25/files6859723679488097151.png "发布列表") +![发布日志](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-04-25/files3662304038159928145.png "发布日志") + +> 流水线任务 + +![流水线配置](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-04-25/files694386343461173439.png "流水线配置") +![流水线任务](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-04-25/files6446052342050924823.png "流水线任务") + +> 消息 + +![操作日志](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-04-25/files1778166520525763829.png "操作日志") +![站内信](https://yxythpt.oss-cn-shenzhen.aliyuncs.com/2022-04-25/files1762448910379225648.png "站内信")
## 联系我 联系微信 -
## 支持一下 -微信收款码 -支付宝收款码 - +收款码
## License diff --git a/docs/README.md b/docs/README.md index 01ed713d..fa19ac14 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,7 @@ ## orion-ops 是什么 -`orion-ops` 一站式自动化运维及自动化部署平台, 无 Agent 的方式接入应用, 使用多环境的概念, 提供了机器管理、WebTerminal、 WebSftp、 机器批量执行、日志在线查看、定时调度任务、应用环境维护、应用构建及发布任务 (CI / CD) 等功能, 帮助开发人员快速定位问题, 致力于企业级应用。 +`orion-ops` 一站式自动化运维及自动化部署平台, 无 Agent 的方式接入应用, 使用多环境的概念, 提供了机器管理、WebTerminal、 WebSftp、 机器批量执行、日志在线查看、定时调度任务、应用环境维护、应用构建及发布任务 (CI / CD)、操作流水线等功能, 帮助开发人员快速定位问题, +致力于企业级应用。 Github: https://github.com/lijiahangmax/orion-ops Gitee: https://gitee.com/lijiahangmax/orion-ops @@ -76,12 +77,23 @@ Demo: http://101.43.254.243/ops/#/ ![发布列表](./assert/img/release_list.png "发布列表") ![发布日志](./assert/img/release_log.png "发布日志") +> 流水线任务 + +![流水线配置](./assert/img/pipeline_list.png "流水线配置") +![流水线任务](./assert/img/pipeline_record_list.png "流水线任务") + +> 消息 + +![操作日志](./assert/img/operator_log.png "操作日志") +![站内信](./assert/img/webside_message.png "站内信") + ## 联系我 -微信 + +微信 ## 支持一下 -微信 -支付宝 + +收款码 ## License diff --git a/docs/_sidebar.md b/docs/_sidebar.md index af6a1501..a5e50733 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -5,6 +5,7 @@ * [设计概念](about/concepts.md) * 快速开始 + * [docker安装](quickstart/docker-install.md) * [普通安装](quickstart/install.md) * [FAQ](quickstart/faq.md) @@ -13,9 +14,14 @@ * [执行管理](operator/exec.md) * [调度任务](operator/scheduler.md) * [应用管理](operator/app.md) - * [CD/CD](operator/ci-cd.md) + * [CI/CD](operator/ci-cd.md) * [用户管理](operator/user.md) * [系统管理](operator/system.md) * 进阶指南 * [二次开发](advance/second-dev.md) + * +* 配置模板 + * [java-springboot 项目](template/java-springboot-template.md) + * [java-tomcat 项目](template/java-tomcat-template.md) + * [node-vue 项目](template/node-vue-template.md) diff --git a/docs/about/change-log.md b/docs/about/change-log.md index 875ce20d..4c1f0ec4 100644 --- a/docs/about/change-log.md +++ b/docs/about/change-log.md @@ -1,11 +1,29 @@ +## 1.1.0-beta + +`2022-04-26` `preview` + +🌈 添加应用流水线功能 +🔨 添加日志颜色, 修改日志排版, 可以更直观的查看日志 +🔨 改为异步初始化版本仓库, 减少等待时间 +🔨 现在查看时日志适配 `ANSI` 颜色转义码 `/x1b[m` +🔨 系统统计分析去除 `vcs` 统计 (可能存在 `node_modules` 删除时导致oom) +🔨 应用配置时路径不能包含 `\` +🐞 修复打开 terminal 模态框, 终端字体拥挤 +🐞 修复最大化 terminal 模态框, 终端字体看不到 +🐞 修复创建应用环境后需要手动刷新页面才能重新加载头部选择组件 +🐞 修复部分样式 +⭐ 本次更新文档提供了应用发布文档 + +[如何升级](/about/update.md?id=_101-gt-110-beta) + ## 1.0.1 `2022-04-01` `release` -🌈 系统线程池指标 -🌈 系统站内信功能 -🌈 应用构建/发布统计 -🐞 日志面板读取文件错误的bug +🌈 添加系统线程池指标 +🌈 添加系统站内信功能 +🌈 添加应用构建/发布统计 +🐞 修复日志面板读取文件错误的bug ⭐ 愚人节快乐 [如何升级](/about/update.md?id=_100-gt-101) @@ -14,7 +32,7 @@ `2022-03-24` `release` -🌈 调度任务执行统计 +🌈 添加调度任务执行统计 🔨 WebTerminal Modal 支持开启多个窗口以及最小化 🔨 记录终端连接, Sftp 连接的用户操作日志 🔨 机器默认文件追踪命令可通过机器环境变量配置 diff --git a/docs/about/roadmap.md b/docs/about/roadmap.md index 490491c2..71e6dd60 100644 --- a/docs/about/roadmap.md +++ b/docs/about/roadmap.md @@ -30,6 +30,7 @@ * 定时发布 * 回滚发布 * 应用构建/发布统计 + * CI/CD 流水线操作 * 日志 * tail * 日志列表 @@ -43,22 +44,29 @@ * 登陆IP绑定 * IP黑白名单 * 系统线程池指标 + * 站内信通知 ### 开发中 ⏱ -* 站内信通知 +* 机器连接超时时间, 重试次数在环境变量中可配置 +* 应用发布配置中传输操作可选使用 sftp / scp ### 未开始 ⏳ -* CI/CD 流水线操作 -* docker支持 -* 机器监控 +* 机器监控(CPU 内存 IO NET) * buildChange * 导入导出信息 +* 日志支持最大最小化 +* 清理定时数据: 批量执行, 终端日志, 发布, 构建, 流水线 +* 批量上传文件 +* 选择 tag 构建 +* 流水线统计 +* terminal 代码重构 +* log-appender 代码重构 ### 重构中 🔨 -无 +* 应用统计改为tab形式 (视图 / 折线图) ### 不确定 ❔ @@ -73,6 +81,4 @@ ### 已放弃 ❌ -* ~~log-appender 改为 伪终端~~ (底层无法支持) -* ~~SFTP 拖拽移动~~ (实现复杂) - +* ~~SFTP 拖拽移动~~ (实现过于复杂) diff --git a/docs/about/update.md b/docs/about/update.md index c730cea9..3a9842e1 100644 --- a/docs/about/update.md +++ b/docs/about/update.md @@ -1,5 +1,83 @@ ⚡ 注意: 应用不支持跨版本升级 +## 1.0.1 > 1.1.0-beta + +> sql 脚本 + +```sql +ALTER TABLE `orion-ops`.`web_side_message` +MODIFY COLUMN `create_time` datetime(4) NULL DEFAULT CURRENT_TIMESTAMP(4) COMMENT '创建时间' AFTER `deleted`, +MODIFY COLUMN `update_time` datetime(4) NULL DEFAULT CURRENT_TIMESTAMP(4) ON UPDATE CURRENT_TIMESTAMP(4) COMMENT '修改时间' AFTER `create_time`; + +ALTER TABLE `orion-ops`.`application_action_log` +MODIFY COLUMN `run_status` tinyint(4) NULL DEFAULT 10 COMMENT '状态 10未开始 20进行中 30已完成 40执行失败 50已跳过 60已终止' AFTER `log_path`; + +CREATE TABLE `application_pipeline_task` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id', + `pipeline_id` bigint(20) NULL DEFAULT NULL COMMENT '流水线id', + `pipeline_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '流水线名称', + `profile_id` bigint(20) NULL DEFAULT NULL COMMENT '环境id', + `profile_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '环境名称', + `profile_tag` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '环境tag', + `exec_title` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '执行标题', + `exec_description` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '执行描述', + `exec_status` int(11) NULL DEFAULT NULL COMMENT '执行状态 10待审核 20审核驳回 30待执行 35待调度 40执行中 50执行完成 60执行停止 70执行失败', + `timed_exec` tinyint(4) NULL DEFAULT NULL COMMENT '是否是定时执行 10普通执行 20定时执行', + `timed_exec_time` datetime(4) NULL DEFAULT NULL COMMENT '定时执行时间', + `create_user_id` bigint(20) NULL DEFAULT NULL COMMENT '创建人id', + `create_user_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人名称', + `audit_user_id` bigint(20) NULL DEFAULT NULL COMMENT '审核人id', + `audit_user_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '审核人名称', + `audit_time` datetime(4) NULL DEFAULT NULL COMMENT '审核时间', + `audit_reason` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '审核备注', + `exec_user_id` bigint(20) NULL DEFAULT NULL COMMENT '执行人id', + `exec_user_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '执行人名称', + `exec_start_time` datetime(4) NULL DEFAULT NULL COMMENT '执行开始时间', + `exec_end_time` datetime(4) NULL DEFAULT NULL COMMENT '执行结束时间', + `deleted` tinyint(4) NULL DEFAULT 1 COMMENT '是否删除 1未删除 2已删除', + `create_time` datetime(4) NULL DEFAULT CURRENT_TIMESTAMP(4) COMMENT '创建时间', + `update_time` datetime(4) NULL DEFAULT CURRENT_TIMESTAMP(4) ON UPDATE CURRENT_TIMESTAMP(4) COMMENT '修改时间', + PRIMARY KEY (`id`) USING BTREE, + INDEX `pipeline_id_idx`(`pipeline_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '应用流水线任务' ROW_FORMAT = Dynamic; + +CREATE TABLE `application_pipeline_task_detail` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id', + `pipeline_id` bigint(20) NULL DEFAULT NULL COMMENT '流水线id', + `pipeline_detail_id` bigint(20) NULL DEFAULT NULL COMMENT '流水线详情id', + `task_id` bigint(20) NULL DEFAULT NULL COMMENT '流水线任务id', + `rel_id` bigint(20) NULL DEFAULT NULL COMMENT '引用id', + `app_id` bigint(20) NULL DEFAULT NULL COMMENT '应用id', + `app_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '应用名称', + `app_tag` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '应用tag', + `stage_type` tinyint(4) NULL DEFAULT NULL COMMENT '阶段类型 10构建 20发布', + `stage_config` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '阶段操作配置', + `exec_status` int(11) NULL DEFAULT NULL COMMENT '状态 10未开始 20进行中 30已完成 40执行失败 50已跳过 60已终止', + `exec_start_time` datetime(4) NULL DEFAULT NULL COMMENT '执行开始时间', + `exec_end_time` datetime(4) NULL DEFAULT NULL COMMENT '执行结束时间', + `deleted` tinyint(4) NULL DEFAULT 1 COMMENT '是否删除 1未删除 2已删除', + `create_time` datetime(4) NULL DEFAULT CURRENT_TIMESTAMP(4) COMMENT '创建时间', + `update_time` datetime(4) NULL DEFAULT CURRENT_TIMESTAMP(4) ON UPDATE CURRENT_TIMESTAMP(4) COMMENT '修改时间', + PRIMARY KEY (`id`) USING BTREE, + INDEX `rel_id_idx`(`pipeline_id`, `pipeline_detail_id`, `task_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '应用流水线任务详情' ROW_FORMAT = Dynamic; + +CREATE TABLE `application_pipeline_task_log` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id', + `task_id` bigint(20) NULL DEFAULT NULL COMMENT '流水线任务id', + `task_detail_id` bigint(20) NULL DEFAULT NULL COMMENT '流水线任务详情id', + `log_status` tinyint(4) NULL DEFAULT NULL COMMENT '日志状态 10创建 20执行 30成功 40失败 50停止 60跳过', + `stage_type` tinyint(4) NULL DEFAULT NULL COMMENT '阶段类型 10构建 20发布', + `log_info` varchar(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '日志详情', + `deleted` tinyint(4) NULL DEFAULT 1 COMMENT '是否删除 1未删除 2已删除', + `create_time` datetime(4) NULL DEFAULT CURRENT_TIMESTAMP(4) COMMENT '创建时间', + `update_time` datetime(4) NULL DEFAULT CURRENT_TIMESTAMP(4) ON UPDATE CURRENT_TIMESTAMP(4) COMMENT '修改时间', + PRIMARY KEY (`id`) USING BTREE, + INDEX `record_idx`(`task_id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '应用流水线任务日志' ROW_FORMAT = Dynamic; + +``` + ## 1.0.0 > 1.0.1 > sql 脚本 diff --git a/docs/advance/second-dev.md b/docs/advance/second-dev.md index 59c5d88f..8e18e502 100644 --- a/docs/advance/second-dev.md +++ b/docs/advance/second-dev.md @@ -8,7 +8,8 @@ * Nginx * npm / yarn -⚡ 注意: windows 环境二次开发需要安装 OpenSSH Server +⚡ maven 推荐使用 阿里云 mirror +⚡ windows 环境二次开发需要安装 OpenSSH Server ### 配置 @@ -40,7 +41,8 @@ ``` 5. 运行 - 后端服务启动时需要设置启动参数 `--generator-admin` 来生成默认管理员用户 + 后端服务启动时需要设置启动参数 `--generator-admin` 来生成默认管理员用户 + 启动参数 idea 中设置 `应用设置` > `Environment` > `Program arguments` ### 测试访问 @@ -54,4 +56,3 @@ 如果是密码登录: 机器管理 > 机器列表 > `宿主机` > 更多 > 编辑 > 选择认证方式为密码 > 输入密码 > 确定 如果是秘钥登陆: 机器管理 > 机器秘钥 > 新建 配置完成后测试连接: 机器管理 > 机器列表 > `宿主机` > 更多 > 测试连接 - diff --git a/docs/assert/img/app_build_config.png b/docs/assert/img/app_build_config.png index 2b39c0be..138737a5 100644 Binary files a/docs/assert/img/app_build_config.png and b/docs/assert/img/app_build_config.png differ diff --git a/docs/assert/img/app_list.png b/docs/assert/img/app_list.png index 12d4ee09..3233de83 100644 Binary files a/docs/assert/img/app_list.png and b/docs/assert/img/app_list.png differ diff --git a/docs/assert/img/app_release_config.png b/docs/assert/img/app_release_config.png index 74ce5d69..2200f4fa 100644 Binary files a/docs/assert/img/app_release_config.png and b/docs/assert/img/app_release_config.png differ diff --git a/docs/assert/img/batch_exec.png b/docs/assert/img/batch_exec.png index 1c7dc64a..ff74ccb2 100644 Binary files a/docs/assert/img/batch_exec.png and b/docs/assert/img/batch_exec.png differ diff --git a/docs/assert/img/build_list.png b/docs/assert/img/build_list.png index 85ea5658..70e0ec2a 100644 Binary files a/docs/assert/img/build_list.png and b/docs/assert/img/build_list.png differ diff --git a/docs/assert/img/build_log.png b/docs/assert/img/build_log.png index 0c36d17a..ceb5a3ce 100644 Binary files a/docs/assert/img/build_log.png and b/docs/assert/img/build_log.png differ diff --git a/docs/assert/img/machine_list.png b/docs/assert/img/machine_list.png index b0c067cc..6ef16355 100644 Binary files a/docs/assert/img/machine_list.png and b/docs/assert/img/machine_list.png differ diff --git a/docs/assert/img/operator_log.png b/docs/assert/img/operator_log.png new file mode 100644 index 00000000..c8ce34f4 Binary files /dev/null and b/docs/assert/img/operator_log.png differ diff --git a/docs/assert/img/pipeline_list.png b/docs/assert/img/pipeline_list.png new file mode 100644 index 00000000..723321a3 Binary files /dev/null and b/docs/assert/img/pipeline_list.png differ diff --git a/docs/assert/img/pipeline_record_list.png b/docs/assert/img/pipeline_record_list.png new file mode 100644 index 00000000..21168b59 Binary files /dev/null and b/docs/assert/img/pipeline_record_list.png differ diff --git a/docs/assert/img/release_list.png b/docs/assert/img/release_list.png index 8492db83..a8d5d06b 100644 Binary files a/docs/assert/img/release_list.png and b/docs/assert/img/release_list.png differ diff --git a/docs/assert/img/release_log.png b/docs/assert/img/release_log.png index 404e2f5a..19fb9ff8 100644 Binary files a/docs/assert/img/release_log.png and b/docs/assert/img/release_log.png differ diff --git a/docs/assert/img/scheduler.png b/docs/assert/img/scheduler.png index 4b814675..8adc82b5 100644 Binary files a/docs/assert/img/scheduler.png and b/docs/assert/img/scheduler.png differ diff --git a/docs/assert/img/scheduler_record.png b/docs/assert/img/scheduler_record.png index 38dea0dd..c4255fac 100644 Binary files a/docs/assert/img/scheduler_record.png and b/docs/assert/img/scheduler_record.png differ diff --git a/docs/assert/img/scheduler_record_log.png b/docs/assert/img/scheduler_record_log.png index 6323e0e4..1c0aab26 100644 Binary files a/docs/assert/img/scheduler_record_log.png and b/docs/assert/img/scheduler_record_log.png differ diff --git a/docs/assert/img/support_pay.jpg b/docs/assert/img/support_pay.jpg new file mode 100644 index 00000000..3547a002 Binary files /dev/null and b/docs/assert/img/support_pay.jpg differ diff --git a/docs/assert/img/template_boot_build.png b/docs/assert/img/template_boot_build.png new file mode 100644 index 00000000..bd28479d Binary files /dev/null and b/docs/assert/img/template_boot_build.png differ diff --git a/docs/assert/img/template_boot_release_1.png b/docs/assert/img/template_boot_release_1.png new file mode 100644 index 00000000..d611fa9a Binary files /dev/null and b/docs/assert/img/template_boot_release_1.png differ diff --git a/docs/assert/img/template_boot_release_2.png b/docs/assert/img/template_boot_release_2.png new file mode 100644 index 00000000..be758702 Binary files /dev/null and b/docs/assert/img/template_boot_release_2.png differ diff --git a/docs/assert/img/template_tomcat_build.png b/docs/assert/img/template_tomcat_build.png new file mode 100644 index 00000000..e30c5c62 Binary files /dev/null and b/docs/assert/img/template_tomcat_build.png differ diff --git a/docs/assert/img/template_tomcat_release_1.png b/docs/assert/img/template_tomcat_release_1.png new file mode 100644 index 00000000..279f0989 Binary files /dev/null and b/docs/assert/img/template_tomcat_release_1.png differ diff --git a/docs/assert/img/template_tomcat_release_2.png b/docs/assert/img/template_tomcat_release_2.png new file mode 100644 index 00000000..e4cfce7f Binary files /dev/null and b/docs/assert/img/template_tomcat_release_2.png differ diff --git a/docs/assert/img/template_vue_build_1.png b/docs/assert/img/template_vue_build_1.png new file mode 100644 index 00000000..c4a5d5b2 Binary files /dev/null and b/docs/assert/img/template_vue_build_1.png differ diff --git a/docs/assert/img/template_vue_build_2.png b/docs/assert/img/template_vue_build_2.png new file mode 100644 index 00000000..42642847 Binary files /dev/null and b/docs/assert/img/template_vue_build_2.png differ diff --git a/docs/assert/img/template_vue_release_1.png b/docs/assert/img/template_vue_release_1.png new file mode 100644 index 00000000..9c70e81b Binary files /dev/null and b/docs/assert/img/template_vue_release_1.png differ diff --git a/docs/assert/img/template_vue_release_2.png b/docs/assert/img/template_vue_release_2.png new file mode 100644 index 00000000..29bf7d42 Binary files /dev/null and b/docs/assert/img/template_vue_release_2.png differ diff --git a/docs/assert/img/webside_message.png b/docs/assert/img/webside_message.png new file mode 100644 index 00000000..15bc5654 Binary files /dev/null and b/docs/assert/img/webside_message.png differ diff --git a/docs/operator/app.md b/docs/operator/app.md index cb2c9868..398d6e0c 100644 --- a/docs/operator/app.md +++ b/docs/operator/app.md @@ -8,7 +8,7 @@ * 配置: 配置应用的基本信息, 构建操作, 发布操作 * 构建: 执行应用构建操作 -* 发布: 执行应用发布操作 +* 发布: 创建应用发布任务 `CI/CD` > `应用发布` * 同步: 同步构建发布配置到其他环境 * 复制: 复制当前应用, 会复制应用的环境变量, 构建配置, 发布配置 @@ -43,19 +43,22 @@ * 也有可能构建完成后不会生成产物, 或者已经将文件传输过了, 这时候这个路径就随便设置一个存在的文件即可 -⚡ 注意: 如果产物路径是一个文件夹, 构建完成后会自动将次文件夹进行 `zip` 压缩, 如设置的路径为 `xxx/dist` 则会生成一个 `dist.zip` +⚡ 注意: 如果产物路径是一个文件夹, 构建完成后会自动将次文件夹进行 `zip` 压缩, 如设置的路径为 `xxx/dist` 则会生成一个 `xxx/dist.zip` +⚡ 注意: 构建产物路径中不能包含 `\` 应该用 `/` 替换。 +⚡ 注意: 执行结果的成功与否是通过执行命令的 `exitcode` 是否为 `0` 来判断的。 如果应用配置了版本仓库, 会有 `添加检出操作` 这个选项 (git clone)。 构建时系统提供了几个默认的变量, 使用 `@{build.xxx}` 来替换。 -| key | 示例 | 描述 | -| :---- | :--- | :---- | -| build_id | 10 | 构建id (数据库自增) | -| build_seq | 1 | 当前环境该应用的构建序列 | -| vcs_home | /orion/vcs/2/10 | 当前应用配置的版本仓库的 `clone` 目录 (如果有) | -| branch | origin/master | 构建所选的 `branch` | -| commit | 8ab50bada8525f6670c36114ad46baa70efda820 | 构建所选的 `commit` | +| key | 示例 | 描述 | +| :---- | :--- | :---- | +| build_id | 10 | 构建id (数据库自增) | +| build_seq | 1 | 当前环境该应用的构建序列 | +| vcs_home | /orion/vcs/2/10 | 当前应用配置的版本仓库的 `clone` 目录 (如果有) | +| vcs_event_home | /orion/vcs/event/2 | 版本仓库的 (获取分支/commit) 目录(只有一个 ) | +| branch | origin/master | 构建所选的 `branch` | +| commit | 8ab50bada8525f6670c36114ad46baa70efda820 | 构建所选的 `commit` | > ##### 发布配置 @@ -66,9 +69,12 @@ 如: 构建产物是 `xxx.jar` 这里可以配置为 `/data/projects/build.jar` 如果构建产物是一个文件夹, 这里可选择传输产物文件夹 `文件夹` 或者 产物文件夹的zip压缩文件 `zip` -如: 构建产物是 `xxx\dist` 文件夹, 文件夹传输类型选择 `文件夹` 这里可以配置为 `/data/projects/dist` +如: 构建产物是 `xxx/dist` 文件夹, 文件夹传输类型选择 `文件夹` 这里可以配置为 `/data/projects/dist` 文件夹传输类型选择 `zip` 这里可以配置为 `/data/projects/dist.zip` 然后在进行解压 +⚡ 注意: 产物传输路径中不能包含 `\` 应该用 `/` 替换。 +⚡ 注意: 执行结果的成功与否是通过执行命令的 `exitcode` 是否为 `0` 来判断的。 + 发布时系统提供了几个默认的变量, 使用 `@{release.xxx}` 来替换。 | key | 示例 | 描述 | @@ -77,6 +83,13 @@ | release_title | 紧急发布 | 发布标题 | | transfer_path | /data/projects/build.jar | 传输路径 | +### 流水线配置 + +设计思路: 以流水线的形式执行应用构建及发布, 一个流水线任务同时执行项目的所有模块的构建以及发布。 + +* 执行: 创建流水线任务 `CI/CD` > `流水线任务` +* 配置: 配置流水线执行操作 + ### 环境变量 配置不同环境的应用环境变量, 不同环境之间的变量是相互隔离的。 @@ -114,8 +127,9 @@ java -jar xxx.jar --spring.profiles.active=dev -Xmx128m -Xms64m ### 版本仓库 配置应用的版本仓库, 仅支持 `git`, 用于构建时选择构建的 `branch` 以及 `commit`。 -可以通过 `密码` 或 `令牌` 方式导入仓库 +可以通过 `密码` 或 `令牌` 方式导入仓库。 -* 初始化: 初始化版本仓库, 验证密码或者token -* 重新初始化: 重新初始化版本仓库 -* 清空: 清空应用构建历史版本, 会保留两个版本, 防止清空正在进行中的构建任务 +* 初始化: 初始化版本仓库, 验证密码或者token `vcs_event_home` +* 重新初始化: 重新初始化版本仓库 `vcs_event_home` + +[comment]: <> (* 清空: 清空应用构建历史版本, 会保留两个版本, 防止清空正在进行中的构建任务) diff --git a/docs/operator/ci-cd.md b/docs/operator/ci-cd.md index 8787b6b6..19bd8ae1 100644 --- a/docs/operator/ci-cd.md +++ b/docs/operator/ci-cd.md @@ -2,7 +2,7 @@ 选择 `已配置` 的应用进行构建操作。 -* 重新构建: 基于选择的 `branch` 和 `commit` 再次执行构建操作, 如果修改了应用构建配置, 则会是新的配置。 +* 重新构建: 基于选择的 `branch` 和 `commit` 再次执行构建操作, 如果修改了应用构建配置, 则会是新的配置 * 停止: 停止本次构建操作 ⚡ 按住 `Ctrl` 点击 `日志` 可以打开一个新页面, 否则将会打开一个模态框。 @@ -12,17 +12,28 @@ 选择 `已配置` 的应用进行发布操作。 -* 审核: 管理员按钮, 如果该环境配置了发布审核, 则需要管理员进行审核, 审核通过后才可以进行发布操作。 -* 发布: 执行应用发布操作。 -* 定时: 将未发布的发布操作设置定时发布时间。 -* 复制: 复制发布应用, 如果修改了应用构建配置, 发布操作仍然是当前发布任务的发布操作。 -* 回滚: 回滚发布应用, 再次执行当前发布任务的发布操作, 如果构建产物不存在则无法回滚。 -* 取消: 取消应用定时发布。 -* 停止: 停止本次发布操作。 +* 审核: 管理员按钮, 如果该环境配置了发布审核, 则需要管理员进行审核, 审核通过后才可以进行发布操作 +* 发布: 执行应用发布任务 +* 定时: 将未发布的任务设置定时发布时间 +* 复制: 复制发布应用, 如果修改了应用构建配置, 发布任务仍然是当前发布任务的发布操作 +* 回滚: 回滚发布应用, 再次执行当前发布任务, 如果构建产物不存在则无法回滚 +* 取消: 取消应用定时发布 +* 停止: 停止本次发布任务 ⚡ 按住 `Ctrl` 点击 `日志` 可以打开一个新页面, 否则将会打开一个模态框。 ⚡ 只有 `已配置` 的应用才可以进行发布操作。 +### 流水线任务 + +选择 `流水线` 进行执行操作。 + +* 审核: 管理员按钮, 如果该环境配置了发布审核, 则需要管理员进行审核, 审核通过后才可以进行执行操作 +* 执行: 执行流水线任务 +* 定时: 将未执行的任务设置定时执行时间 +* 复制: 复制当前选择的流水线任务 +* 取消: 取消定时执行流水线任务 +* 停止: 停止本次流水线任务 + ### 构建统计 可以查看近七天的应用构建统计数据, 近十次构建视图, 以及调度统计图表。 diff --git a/docs/operator/scheduler.md b/docs/operator/scheduler.md index 28ce8cfb..83795751 100644 --- a/docs/operator/scheduler.md +++ b/docs/operator/scheduler.md @@ -4,7 +4,8 @@ 设计理念与批量执行相同, 只不过是不用人为去触发任务执行。 新建任务时鼠标悬停到执行时间上可以得到最近的执行时间。 -⚡ 注意: 修改后状态会变为停用状态, 需要手动启用。 +⚡ 注意: 修改后状态会变为停用状态, 需要手动启用。 +⚡ 注意: 执行结果的成功与否是通过执行命令的 `exitcode` 是否为 `0` 来判断的。 ### 执行记录 diff --git a/docs/operator/user.md b/docs/operator/user.md index a63b6224..5731feea 100644 --- a/docs/operator/user.md +++ b/docs/operator/user.md @@ -2,10 +2,10 @@ 系统用户列表。 -* 解锁: 解锁已锁定的用户 -* 禁用: 禁用用户使该用户无法登陆 * 日志: 查看操作日志 -* 重置密码: 重置用户密码 +* 解锁: 管理员按钮, 解锁已锁定的用户 +* 禁用: 管理员按钮, 禁用用户使该用户无法登陆 +* 重置密码: 管理员按钮, 重置用户密码 ### 个人信息 diff --git a/docs/quickstart/docker-install.md b/docs/quickstart/docker-install.md new file mode 100644 index 00000000..36befa42 --- /dev/null +++ b/docs/quickstart/docker-install.md @@ -0,0 +1 @@ +后续补上... diff --git a/docs/quickstart/faq.md b/docs/quickstart/faq.md index 72605c78..a1880200 100644 --- a/docs/quickstart/faq.md +++ b/docs/quickstart/faq.md @@ -59,7 +59,6 @@ server { ⛔ 不建议上传特别大的文件, 可能会出现 `OOM`
- > ##### 8. 应用构建时提示 '版本控制仓库操作执行失败'? 应用管理 > 版本仓库 找到应用关联的仓库, 检查密码/token后 重新初始化即可 @@ -79,3 +78,32 @@ server { 将构建产物路径设置为一个已存在的文件的绝对路径即可
+ +> ##### 12. 为什么会找不到环境变量? + +可以在执行命令的第一行设置 `source /etc/profile` 来加载环境变量 +
+ +> ##### 13. nohup 为什么无法启动程序? + +执行命令行使用的伪终端关闭时会停止终端进程, 可以使用 sleep 来跳过 +`(nohup java -jar springboot-0.0.1-SNAPSHOT.jar >> run.log 2>&1 &) && sleep 1` +
+ +> ##### 14. 命令中途执行失败如何设置中断执行? + +可以在执行命令的第一行设置 `set -e` +作用是: 当执行出现意料之外的情况时, 立即退出 +
+ +> ##### 15. 在调度任务、应用构建、应用发布 命令执行成功的依据是什么? + +是获取命令的 `exitcode` 判断是否为 `0` 如果非0则代表命令执行失败 +同理, 在命令的最后一行设置 `exit 1` 结果将会是失败, 可以用此来中断后续流程 +
+ +> ##### 16. docker 运行 orion-ops-service 失败提示 `sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264)` + +原因是用户创建时会生成默认的头像, 依赖于 `awt` 绘制 +启动时需要添加 `RUN apk add --update ttf-dejavu fontconfig` +
diff --git a/docs/template/java-springboot-template.md b/docs/template/java-springboot-template.md new file mode 100644 index 00000000..4c66c1ef --- /dev/null +++ b/docs/template/java-springboot-template.md @@ -0,0 +1,77 @@ +#### springboot 项目模板 + +以一个普通的 maven 构建的 springboot 项目为例 +构建操作为: `checkout` > `maven build` +发布操作为: `删除旧版文件` > `传输文件` > `nohup java -jar demo-1.0.0-SNAPSHOT.jar &` +
+ +> 构建配置 + +![构建配置](../assert/img/template_boot_build.png "构建配置") + +> 发布配置 + +![发布配置1](../assert/img/template_boot_release_1.png "发布配置1") +![发布配置2](../assert/img/template_boot_release_2.png "发布配置2") + +#### 构建配置 + +> 构建产物路径 + +``` +构建产物路径一般是在代码目录下的 target/xxx.jar +target/demo-1.0.0-SNAPSHOT.jar +``` + +> 构建操作1 检出代码 + +无需操作 + +> 构建操作2 构建应用 + +``` +source /etc/profile +echo '开始构建' +cd @{build.vcs_home} +mvn -U clean install -DskipTests +echo '构建完成' +``` + +#### 发布配置 + +> 发布操作1 删除旧版文件 + +``` +jarFile=/data/dist/demo.jar +if [ -f "$jarFile" ]; then + rm -rf $jarFile + echo '删除/data/dist/demo.jar' +fi +``` + +> 发布操作2 传输文件 + +``` +设置一个传输产物文件的绝对路径 +/data/dist/demo.jar +``` + +> 发布操作3 启动项目 + +``` +source /etc/profile +jarName=demo.jar +# kill +PID=$(ps -ef | grep $jarName | grep -v grep | awk '{print $2}') +if [ ! -z $PID ]; then + kill -9 $PID + echo 'kill' $PID +fi + +# 启动 +echo '启动项目' +cd /data/dist +(nohup java -jar $jarName >> run.log 2>&1 &) && sleep 1 +echo '启动完成' +``` + diff --git a/docs/template/java-tomcat-template.md b/docs/template/java-tomcat-template.md new file mode 100644 index 00000000..d98be401 --- /dev/null +++ b/docs/template/java-tomcat-template.md @@ -0,0 +1,79 @@ +#### tomcat 项目模板 + +以一个普通的 maven 构建的 web 项目为例 +构建操作为: `checkout` > `maven build` +发布操作为: `删除 tomcat/webapps/ROOT 和 ROOT.war` > `传输ROOT.war` > `shutdown.sh` > `startup.sh` +
+ +> 构建配置 + +![构建配置](../assert/img/template_tomcat_build.png "构建配置") + +> 发布配置 + +![发布配置1](../assert/img/template_tomcat_release_1.png "发布配置1") +![发布配置2](../assert/img/template_tomcat_release_2.png "发布配置2") + +#### 构建配置 + +> 构建产物路径 + +``` +构建产物路径一般是在代码目录下的 target/xxx.war +target/demo-1.0.0-SNAPSHOT.war +``` + +> 构建操作1 检出代码 + +无需操作 + +> 构建操作2 构建应用 + +``` +source /etc/profile +echo '开始构建' +cd @{build.vcs_home} +mvn -U clean install -DskipTests +echo '构建完成' +``` + +#### 发布配置 + +> 发布操作1 删除原有文件 + +``` +ROOT_PATH=/data/apache-tomcat-9.0.62/ROOT +ROOT_WAR=/data/apache-tomcat-9.0.62/ROOT.war +if [ -d "$ROOT_PATH" ]; then + rm -rf $ROOT_PATH + echo '删除ROOT文件夹' +fi + +if [ -f "$ROOT_WAR" ]; then + rm -rf $ROOT_WAR + echo '删除ROOT.war' +fi +``` + +> 发布操作2 传输文件 + +``` +传输产物文件的绝对路径应该为 tomcat/webapps 下的 ROOT.war 或 项目名称.war +/data/apache-tomcat-9.0.62/webapps/ROOT.war +``` + +> 发布操作3 启动项目 + +``` +cd /data/apache-tomcat-9.0.62/bin + +# 关闭 +echo '关闭项目' +./shutdown.sh + +# 启动 +echo '启动项目' +(nohup ./startup.sh >> start.log 2>&1 &) && sleep 1 +echo '启动完成' +``` + diff --git a/docs/template/node-vue-template.md b/docs/template/node-vue-template.md new file mode 100644 index 00000000..516585af --- /dev/null +++ b/docs/template/node-vue-template.md @@ -0,0 +1,82 @@ +#### vue 项目模板 + +以一个普通的 npm 构建的 vue 项目为例 +构建操作为: `checkout` > `npm i` > `npm run build` +发布操作为: `删除旧版文件` > `传输文件` > `复制到 nginx 静态目录` > `启动nginx` +
+ +> 构建配置 + +![构建配置1](../assert/img/template_vue_build_1.png "构建配置1") +![构建配置2](../assert/img/template_vue_build_2.png "构建配置2") + +> 发布配置 + +![发布配置1](../assert/img/template_vue_release_1.png "发布配置1") +![发布配置2](../assert/img/template_vue_release_2.png "发布配置2") + +#### 构建配置 + +> 构建产物路径 + +``` +构建产物路径一般是在代码目录下的 dist 目录 +dist +``` + +> 构建操作1 创建公共node_modules + +``` +给不同环境下的每个应用创建公共 node_modules 目录, 以后每次构建都通过软链接的形式引用, 避免每次构建时都要全量安装依赖 +这里的 @{app.profile_id} 代表应用环境id, @{app.app_id} 代表应用id, 在运行时会动态替换 +mkdir -p /data/public/@{app.profile_id}/@{app.app_id}/node_modules +``` + +> 构建操作2 检出代码 + +无需操作 + +> 构建操作3 构建应用 + +``` +source /etc/profile +cd @{build.vcs_home} +# 软连接 node_modules +ln -s /data/public/@{app.profile_id}/@{app.app_id}/node_modules . +# 构建 +echo '开始构建' +cnpm i +cnpm run build +echo '构建完成' +``` + +#### 发布配置 + +> 发布操作1 删除原有文件 + +``` +distPath=/data/dist-web/dist +if [ -d "$distPath" ]; then + rm -rf $distPath + echo '删除/data/dist-web/dist' +fi +``` + +> 发布操作2 传输文件 + +``` +设置一个传输产物文件的绝对路径 +/data/dist-web/dist +``` + +> 发布操作3 复制到 nginx 目录并且重启 + +``` +target=/data/orion/web/test1 +if [ -d $target ]; then + rm -rf $target +fi +mkdir $target +cp -r /data/dist-web/dist/* $target +service nginx restart +```