add ci/cd

This commit is contained in:
jagger 2025-05-14 17:47:18 +08:00
parent 7056e1db19
commit 6c50ab29bb
3 changed files with 116 additions and 38 deletions

58
.devops/aly.yml Normal file
View File

@ -0,0 +1,58 @@
version: 2
name: aly
description: 阿里云sealos环境
global:
concurrent: 1
cache:
- GOCACHE
- GOMODCACHE
workflow:
- ref: start
name: 开始
task: start
- ref: git_clone_0
name: git clone
task: git_clone@1.2.9
input:
remote_url: '"https://gitlink.org.cn/JointCloud/pcm-openi.git"'
ref: '"refs/heads/master"'
commit_id: '""'
depth: 1
needs:
- start
- ref: docker_image_build_0
name: docker镜像构建
cache:
GOCACHE: /root/.cache/go-build
GOMODCACHE: /go/pkg/mod
task: docker_image_build@1.6.0
input:
docker_username: ((aly.docker_user))
docker_password: ((aly.docker_password))
image_name: '"registry.cn-hangzhou.aliyuncs.com/jcce/pcm-openi"'
image_tag: '"latest"'
registry_address: '"registry.cn-hangzhou.aliyuncs.com"'
docker_file: '"Dockerfile"'
docker_build_path: '"."'
workspace: git_clone_0.git_path
image_clean: true
image_push: true
build_args: '""'
needs:
- git_clone_0
- ref: end
name: 结束
task: end
needs:
- ssh_cmd_0
- ref: ssh_cmd_0
name: ssh执行命令
task: ssh_cmd@1.1.1
input:
ssh_private_key: ((aly.ssh_private_key))
ssh_ip: '"47.92.39.128"'
ssh_port: '"22"'
ssh_user: '"root"'
ssh_cmd: '"kubectl rollout restart deployment pcm-openi -n ns-admin"'
needs:
- docker_image_build_0

View File

@ -0,0 +1,58 @@
version: 2
name: tencent-develop
description: 腾讯云开发环境
global:
concurrent: 1
cache:
- GOCACHE
- GOMODCACHE
workflow:
- ref: start
name: 开始
task: start
- ref: git_clone_0
name: git clone
task: git_clone@1.2.9
input:
remote_url: '"https://gitlink.org.cn/JointCloud/pcm-openi.git"'
ref: '"refs/heads/master"'
commit_id: '""'
depth: 1
needs:
- start
- ref: docker_image_build_0
name: docker镜像构建
cache:
GOCACHE: /root/.cache/go-build
GOMODCACHE: /go/pkg/mod
task: docker_image_build@1.6.0
input:
docker_username: ((aly.docker_user))
docker_password: ((aly.docker_password))
image_name: '"registry.cn-hangzhou.aliyuncs.com/jcce/pcm-openi"'
image_tag: '"dev-latest"'
registry_address: '"registry.cn-hangzhou.aliyuncs.com"'
docker_file: '"Dockerfile"'
docker_build_path: '"."'
workspace: git_clone_0.git_path
image_clean: true
image_push: true
build_args: '""'
needs:
- git_clone_0
- ref: end
name: 结束
task: end
needs:
- ssh_cmd_0
- ref: ssh_cmd_0
name: ssh执行命令
task: ssh_cmd@1.1.1
input:
ssh_private_key: ((aly.ssh_private_key))
ssh_ip: '"119.45.255.234"'
ssh_port: '"22"'
ssh_user: '"root"'
ssh_cmd: '"kubectl rollout restart deployment -n jcce-system pcm-openi"'
needs:
- docker_image_build_0

View File

@ -1,38 +0,0 @@
version: 2
name: 未命名项目
description: ""
global:
concurrent: 1
param:
- ref: aaaa
name: ""
value: '""'
required: false
type: STRING
hidden: false
workflow:
- ref: start
name: 开始
task: start
- ref: allure_report_0
name: allure报表生成
task: allure_report@1.0.3-allure2.15.0
input:
allure_results_path: '""'
needs:
- start
- ref: text_file_0
name: 文本文件工具
task: text_file@1.0.0-nodejs16.13.1
input:
expression: '""'
path: '""'
needs:
- start
- ref: end
name: 结束
task: end
needs:
- allure_report_0
- text_file_0