successful.log文件)xxx为需要用户自行替换的字段,具体含义详见参数介绍-核心参数。docker run --rm \ -e PLUGIN_SOURCE_TOKEN="xxx" \ -e PLUGIN_CNB_ROOT_ORGANIZATION="xxx" \ -e PLUGIN_CNB_TOKEN="xxx" \ -v $(pwd):$(pwd) -w $(pwd) \ cnbcool/code-import
docker run --rm \ -e PLUGIN_SOURCE_TOKEN="xxx" \ -e PLUGIN_SOURCE_URL="https://github.com" \ -e PLUGIN_SOURCE_PLATFORM="github" \ -e PLUGIN_CNB_ROOT_ORGANIZATION="xxx" \ -e PLUGIN_CNB_TOKEN="xxx" \ -v $(pwd):$(pwd) -w $(pwd) \ cnbcool/code-import
docker run --rm \ -e PLUGIN_SOURCE_TOKEN="xxx" \ -e PLUGIN_SOURCE_URL="https://gitlab.com" \ -e PLUGIN_SOURCE_PLATFORM="gitlab" \ -e PLUGIN_CNB_ROOT_ORGANIZATION="xxx" \ -e PLUGIN_CNB_TOKEN="xxx" \ -v $(pwd):$(pwd) -w $(pwd) \ cnbcool/code-import
docker run --rm \ -e PLUGIN_SOURCE_TOKEN="xxx" \ -e PLUGIN_SOURCE_URL="https://gitee.com" \ -e PLUGIN_SOURCE_PLATFORM="gitee" \ -e PLUGIN_CNB_ROOT_ORGANIZATION="xxx" \ -e PLUGIN_CNB_TOKEN="xxx" \ -v $(pwd):$(pwd) -w $(pwd) \ cnbcool/code-import
docker run --rm \ -e PLUGIN_SOURCE_USERNAME="xxx" \ -e PLUGIN_SOURCE_PASSWORD="xxx" \ -e PLUGIN_SOURCE_PLATFORM="aliyun" \ -e PLUGIN_SOURCE_AK="xxx" \ -e PLUGIN_SOURCE_AS="xxx" \ -e PLUGIN_SOURCE_ORGANIZATIONID="xxx" \ -e PLUGIN_CNB_ROOT_ORGANIZATION="xxx" \ -e PLUGIN_CNB_TOKEN="xxx" \ -v $(pwd):$(pwd) -w $(pwd) \ cnbcool/code-import
http协议
docker run --rm \ -e PLUGIN_SOURCE_USERNAME="xxx" \ -e PLUGIN_SOURCE_PASSWORD="xxx" \ -e PLUGIN_SOURCE_REPO="group1/repo1,group1/repo2,group2/repo3" \ -e PLUGIN_SOURCE_URL="https://common.example.com" \ -e PLUGIN_SOURCE_PLATFORM="common" \ -e PLUGIN_CNB_ROOT_ORGANIZATION="xxx" \ -e PLUGIN_CNB_TOKEN="xxx" \ -v $(pwd):$(pwd) -w $(pwd) \ cnbcool/code-import
ssh协议
⚠️使用ssh协议时请在当前工作目录确保有对应的私钥文件,文件名固定为ssh.key
docker run --rm \ -e PLUGIN_SOURCE_REPO="group1/repo1,group1/repo2,group2/repo3" \ -e PLUGIN_SOURCE_URL="https://common.example.com" \ -e PLUGIN_SOURCE_PLATFORM="common" \ -e PLUGIN_CNB_ROOT_ORGANIZATION="xxx" \ -e PLUGIN_CNB_TOKEN="xxx" \ -e GIT_SSH_COMMAND='ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' \ -v $(pwd):$(pwd) -w $(pwd) \ cnbcool/code-import
迁移指定根组织下所有仓库
docker run --rm \ -e PLUGIN_SOURCE_GROUP="xxx" \ -e PLUGIN_SOURCE_TOKEN="xxx" \ -e PLUGIN_SOURCE_URL="https://cnb.example1.com" \ -e PLUGIN_SOURCE_PLATFORM="cnb" \ -e PLUGIN_CNB_ROOT_ORGANIZATION="xxx" \ -e PLUGIN_CNB_TOKEN="xxx" \ -e PLUGIN_CNB_URL="https://cnb.example2.com" \ -v $(pwd):$(pwd) -w $(pwd) \ cnbcool/code-import
PLUGIN_SOURCE_URL
PLUGIN_SOURCE_TOKEN
PLUGIN_SOURCE_PLATFORM
PLUGIN_SOURCE_REPO
PLUGIN_SOURCE_USERNAME
PLUGIN_SOURCE_PASSWORD
PLUGIN_SOURCE_AK
PLUGIN_SOURCE_AS
PLUGIN_SOURCE_ENDPOINT
PLUGIN_SOURCE_ORGANIZATIONID
PLUGIN_CNB_URL
PLUGIN_CNB_TOKEN
PLUGIN_CNB_ROOT_ORGANIZATION
PLUGIN_SOURCE_GROUP
PLUGIN_MIGRATE_TYPE
PLUGIN_MIGRATE_CONCURRENCY
PLUGIN_MIGRATE_FORCE_PUSH
PLUGIN_MIGRATE_SKIP_EXISTS_REPO
PLUGIN_MIGRATE_USE_LFS_MIGRATE
PLUGIN_MIGRATE_ORGANIZATION_MAPPING_LEVEL
PLUGIN_MIGRATE_ALLOW_INCOMPLETE_PUSH
PLUGIN_MIGRATE_LOG_LEVEL
PLUGIN_MIGRATE_RELEASE
PLUGIN_MIGRATE_FILE_LIMIT_SIZE
PLUGIN_MIGRATE_CODE
PLUGIN_MIGRATE_SSH
PLUGIN_MIGRATE_REBASE
.cnb.yml文件,使用git rebase保证代码同步,CNB侧提交的流水线配置代码不会被覆盖
⚠️如开启该配置,将启用强制推送(PLUGIN_MIGRATE_FORCE_PUSH="true"),并在迁移工具执行的工作目录备份CNB侧代码仓库PLUGIN_SOURCE_PROJECT
单个文件超过500MB大小限制
可以开启PLUGIN_MIGRATE_USE_LFS_MIGRATE参数