0
2
Login
main
chore: 更新Docker镜像构建和推送配置
vincent
2 commits
Name
Commit
Updated at

Coding项目协同迁移到CNB工具

功能介绍:

  1. Coding项目协同需求、缺陷、任务、事项迁移至CNB
  2. 只支持标题、描述、类型、优先级等基础属性迁移
  3. 自动跳过已迁移事项,避免数据重复(依赖工作目录下的successful.log

⚠️迁移前必读

  1. 迁移前请CNB根组织已创建。

在Docker上使用

docker run --rm  \
  -e PLUGIN_CODING_TOKEN="xxx"  \
  -e PLUGIN_CNB_ROOT_ORGANIZATION="xxx" \
  -e PLUGIN_CNB_TOKEN="xxx"  \
  -v $(pwd):$(pwd) -w $(pwd) \
  docker.cnb.cool/coding/tool/migrate-collaboration/cnb:latest

在云原生构建上使用

# .cnb.yml
$:
  tag_push:
    - stages:
        - name: Coding 项目协同迁移至 CNB
          image: docker.cnb.cool/coding/tool/migrate-collaboration/cnb:latest
          settings:
            coding_token: xxx
            cnb_root_organization: xxx
            cnb_token: xxx
        - name: 持久化迁移日志
          script: |
            #!/usr/bin/env bash
            set -e
            git add .
            git commit -m "upload log"
            git push origin HEAD:main

参数

coding_token

  • 类型: 字符串
  • 必填: 否

Coding 访问令牌,个人账户设置-访问令牌。

权限要求:

  • 项目信息-只读
  • 项目协同-只读

cnb_token

  • 类型: 字符串
  • 必填: 是

CNB访问令牌,权限要求:
repo-code:rw,group-resource:rw,group-manage:rw,repo-issue:rw,repo-notes:rw,repo-manage:rw

migrate_days

  • 类型:正整数
  • 必填:否
  • 默认值:0

迁移多少天内创建的事项,默认迁移全部

log_level

  • 类型: 字符串
  • 必填: 否
  • 枚举: debug,info,warn,error
  • 默认值: info

日志级别,默认info