### Install Git and SVN on Ubuntu Source: https://help.aliyun.com/zh/yunxiao/user-guide/migrate-svn-repository-to-git Installs Git and SVN on Ubuntu using apt-get. This is the first step before installing git-svn. ```sh apt-get install git subversion ``` -------------------------------- ### NPM 和 GoLang 配置 git config 命令 Source: https://help.aliyun.com/zh/yunxiao/user-guide/set-dependent-download-access-credentials 在 npm install 或 go get 之前添加此命令,使用环境变量 GIT_USERNAME 和 GIT_PASSWORD 配置 Git 仓库访问凭证。将 codeup.aliyun.com 替换为实际使用的 Git 仓库域名。 ```shell git config --global url."https://${GIT_USERNAME}:${GIT_PASSWORD}@codeup.aliyun.com".insteadOf "https://codeup.aliyun.com" ``` -------------------------------- ### Build and install commands for a new step Source: https://help.aliyun.com/zh/yunxiao/user-guide/use-flow-cli-to-customize-development-steps These commands are executed after initialization to install dependencies and build the step. The example shows changing into the step directory, running npm install, and then npm run build. The build produces a dist directory containing dist/index.js, which is the actual file executed by Flow. ```bash cd HelloV2StepWorld && npm install && npm run build ``` -------------------------------- ### Response example Source: https://help.aliyun.com/zh/yunxiao/developer-reference/query-scheduled-task-execution-records Example JSON response showing the structure of runs and steps. ```json { "runs": [ { "eventId": "", "finishedAt": "", "ruleVersion": 0, "startedAt": "", "status": "running", "steps": [ { "actionId": "run_ai", "detail": "", "durationMs": 0, "finishedAt": "", "kind": "ai", "startedAt": "", "status": "running" } ], "trigger": "manual" } ], "truncated": false } ``` -------------------------------- ### Install git-filter-repo Source: https://help.aliyun.com/zh/yunxiao/user-guide/git-filter-repo Installs git-filter-repo by copying the executable to /usr/local/bin. Requires sudo privileges. ```sh cd git-filter-repo/ sudo cp git-filter-repo /usr/local/bin ``` -------------------------------- ### Runner 安装日志(Linux Systemd 服务类型) Source: https://help.aliyun.com/zh/yunxiao/user-guide/pipeline-runner 展示在 Linux 上安装 Runner 时选择 Systemd 服务类型的安装日志,包含 install 和 start 命令及服务状态输出。 ```log [INFO] install runner system service /usr/local/share/yunxiao-runner/v0.1.1/runner install --tenant=be-xxx INFO[2024-02-28T11:09:17+08:00] service type linux-systemd INFO[2024-02-28T11:09:17+08:00] Aliyun yunxiao runner-v0.1.1-be-xxx service, linux-systemd installed [INFO] start runner service /usr/local/share/yunxiao-runner/v0.1.1/runner start --tenant=be-xxx INFO[2024-02-28T11:09:17+08:00] service type linux-systemd INFO[2024-02-28T11:09:17+08:00] Aliyun yunxiao runner-v0.1.1-be-xxx service started INFO[2024-02-28T11:09:17+08:00] Aliyun yunxiao runner-v0.1.1-be-xxx service status running ``` -------------------------------- ### Example Response for ListAppReleaseStageExecutionIntegratedMetadata Source: https://help.aliyun.com/zh/yunxiao/developer-reference/api-devops-2021-06-25-listappreleasestageexecutionintegratedmetadata A normal response example in JSON format, showing the structure of the returned data. ```JSON [ { "releaseBranch": "release/20240625-152603220321211_release_3252057_1", "releaseRevision": "a66cfa8c6869b96bb7d111ba2144c9c764d556b7", "repoUrl": "https://codeup.aliyun.com/60d54f3daccf2bbd6659f3ad/auto-test.git", "repoType": "CODEUP", "changeRequests": [ { "sn": "fcd37726a6f84c60b7eb9c5856007c2f", "name": "变更名称", "branchName": "feature/20240625", "commitId": "a66cfa8c6869b96bb7d111ba2144c9c764d556b7", "ownerAccountId": 262579140573491040 } ] } ] ``` -------------------------------- ### Request example for region edition (curl) Source: https://help.aliyun.com/zh/yunxiao/developer-reference/detachtemplate Example curl command for the region edition. Replace {domain} and {name} with actual values. ```bash curl -X 'POST' \ 'https://{domain}/oapi/v1/appstack/apps/{name}/template:detach' \ -H 'Content-Type: application/json' \ -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' ``` -------------------------------- ### curl request example for Central edition Source: https://help.aliyun.com/zh/yunxiao/developer-reference/resumevmdeployorder Example curl command to resume a deployment order in the Central edition, using the x-yunxiao-token header for authentication. ```bash curl -X 'PUT' \ 'https://{domain}/oapi/v1/flow/organizations/5ebbc0228123212b59xxxxx/pipelines/123/deploy/1111/resume' \ -H 'Content-Type: application/json' \ -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' ``` -------------------------------- ### Check git-svn installation and error output Source: https://help.aliyun.com/zh/yunxiao/user-guide/migrate-svn-repository-to-git Running 'git svn' to verify installation. If the SVN::Core module is missing, an error message is displayed. ```sh git svn Can't locate SVN/Core.pm in @INC (you may need to install the SVN::Core module) (@INC contains: /opt/git/dev/share/perl5 /Library/Perl/5.30/darwin-thread-multi-2level ... ) at /opt/git/dev/share/perl5/Git/SVN/Utils.pm line 6. ``` -------------------------------- ### Clone RedlineSonar example repository Source: https://help.aliyun.com/zh/yunxiao/user-guide/scenario-example-developing-sonarqube-scanning-steps-with-redlines Clones the RedlineSonar example repository from atomgit.com to get the sample code for developing a custom SonarQube scanning step. ```shell git clone https://atomgit.com/flow-step-custom/RedlineSonar.git ``` -------------------------------- ### 更新服务端仓库配置 Source: https://help.aliyun.com/zh/yunxiao/user-guide/capacity-and-cleanup-instructions 在example.git中执行git config命令,关闭mirror配置,以便后续强制推送。 ```sh git config remote.origin.mirror false ``` -------------------------------- ### RedlineSonar example directory structure Source: https://help.aliyun.com/zh/yunxiao/user-guide/scenario-example-developing-sonarqube-scanning-steps-with-redlines Shows the directory structure of the RedlineSonar example, including README.md, package.json, src/index.ts, src/params.ts, step.yaml, and TypeScript configuration files. ```shell . ├── README.md # 步骤说明 ├── package.json # typescript 工程包声明 ├── src # 步骤后端执行逻辑 │ ├── index.ts │ └── params.ts ├── step.yaml # 步骤前端展示描述信息 yaml ├── tsconfig.eslint.json └── tsconfig.json ``` -------------------------------- ### Get Pipeline Details API Response (JSON) Source: https://help.aliyun.com/zh/yunxiao/developer-reference/getpipeline-get-pipeline-details Example response from the Get Pipeline Details API. Contains pipeline metadata and the pipelineConfig.flow field with a YAML pipeline definition. The sources array shows a Codeup repository configuration. ```json { "createTime": 1729178040000, "creatorAccountId": "112222122", "envId": 0, "envName": "日常环境", "groupId": 1111, "modifierAccountId": "112222122", "name": "流水线", "pipelineConfig": { "flow": "schema: tb pipeline: - name: 执行命令 stages: - driven: AUTO jobs: - displayName: 执行命令 task: execution-component-production@10 identifier: '10_1626147407245' templateType: task templateSign: '' templateBatchUpdate: 'N' extraInfo: '' params: version1: pre-jdk1.62 steps: - name: 执行命令 stepType: exec-shell stepIdentifier: '10_1626147407245__11_1626147407249' command: | # input your command here echo hello,world! ARTIFACTS: '' JSONEncoding: true freeInTaskGroupModeFields: - ARTIFACTS source: 132504-sss_ddd_3mvJ ENGINE_PIPELINE_NAME: '${INPUTS.ENGINE_PIPELINE_NAME}' ENGINE_PIPELINE_ID: '${INPUTS.ENGINE_PIPELINE_ID}' ENGINE_PIPELINE_INST_ID: '${INPUTS.ENGINE_PIPELINE_INST_ID}' ENGINE_PIPELINE_INST_NUMBER: '${INPUTS.ENGINE_PIPELINE_INST_NUMBER}' buildNodeGroup: K8S-4 plugins: [] output: [] freeInTaskGroupModeFields: []", "settings": "{}", "sources": [ { "data": { "branch": "master", "cloneDepth": 1, "credentialId": 222, "credentialLabel": "企业公钥", "credentialType": "region-ssh", "events": [ ], "isBranchMode": false, "isCloneDepth": true, "isSubmodule": false, "isTrigger": true, "label": "cdup/ss", "namespace": "asasasas", "repo": "https://codeup.aliyun.com/test.git", "serviceConnectionId": 12, "triggerFilter": ".*", "webhook": "https://flow.aliyun/webhook/asassasa" }, "sign": "xxsxsxs", "type": "Codeup" } ] }, "tagList": [ { "id": 22, "name": "标签1" } ], "type": "PIPELINEASCODE", "updateTime": 1729178040000 } ``` -------------------------------- ### 启动脚本示例 Source: https://help.aliyun.com/zh/yunxiao/user-guide/host-deployment-orchestration 在应用环境部署时,每台主机上执行,用于启动服务。典型逻辑是先解压制品包到指定目录,再执行启动文件(如deploy.sh start)。 ```sh # 一个典型的启动脚本逻辑如下:先将制品包解压缩到指定目录中,再执行启动文件(通常在代码中维护,如示例中的deploy.sh)。 mkdir -p /home/admin/application tar zxvf /home/admin/app/package.tgz -C /home/admin/application/ sh /home/admin/application/deploy.sh start ``` -------------------------------- ### 本地推送Maven包时使用settings.xml执行deploy Source: https://help.aliyun.com/zh/yunxiao/user-guide/faq-13 在代码根目录下运行此命令,使用指定的settings.xml文件执行Maven的clean deploy操作,并跳过测试。注意:-s参数应指向拥有私有仓库推送权限的账号下载的settings.xml文件路径。 ```bash mvn clean deploy -s settings.xml -U -DskipTests ``` -------------------------------- ### Maven 本地构建命令(使用自定义 settings.xml 和本地仓库) Source: https://help.aliyun.com/zh/yunxiao/user-guide/faq-13 在代码根目录运行此命令,使用指定的 settings.xml 文件(-s 参数)和本地仓库目录(-Dmaven.repo.local)进行构建,用于排查本地构建下载不到依赖包的问题。注意 -s 参数后为拥有权限拉取私服包的账号登录云效私服下载的 settings.xml 文件路径。 ```bash mvn clean install -s settings.xml -U -DskipTests -Dmaven.repo.local=/tmp/repo ``` -------------------------------- ### 环境变量组配置(灰度环境) Source: https://help.aliyun.com/zh/yunxiao/user-guide/grayscale-release-based-on-nginx-ingress-cloud-effect-appstack 灰度环境变量组的配置示例,设置namespace为demo-pre,host为go.demo.prod。 ```properties # namespace = demo-pre # host = go.demo.prod ``` -------------------------------- ### GET /v1/oauth2/authorize Source: https://help.aliyun.com/zh/yunxiao/developer-reference/oauth-2-0-authorization-support-documentation 授权端点,用于用户登录并确认授权,下发授权码。支持 GET 和 POST 方法,需要用户登录。 ```APIDOC ## GET /v1/oauth2/authorize ### Description 授权端点,用于用户登录并确认授权,下发授权码。支持 GET 和 POST 方法,需要用户登录。 ### Method GET ### Endpoint /v1/oauth2/authorize ### Parameters #### Query Parameters - **response_type** (string) - Required - 响应类型,固定为 "code" - **client_id** (string) - Required - 客户端标识 - **redirect_uri** (string) - Required - 重定向 URI - **scope** (string) - Optional - 请求的权限范围,仅作元数据存储 - **state** (string) - Optional - 客户端状态值,用于防止 CSRF - **code_challenge** (string) - Required - PKCE 挑战值 - **code_challenge_method** (string) - Required - PKCE 挑战方法,固定为 "S256" ### Request Example GET /v1/oauth2/authorize?response_type=code&client_id=example-client-id&redirect_uri=https%3A%2F%2Fclient.example.com%2Fcallback&scope=read&state=xyz&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&code_challenge_method=S256 ### Response #### Success Response (302) - **Location** (string) - 重定向到 redirect_uri,携带 code 和 state 参数 #### Response Example HTTP/1.1 302 Found Location: https://client.example.com/callback?code=example-auth-code&state=xyz ``` -------------------------------- ### 初始化无分支的 SVN 仓库 Source: https://help.aliyun.com/zh/yunxiao/user-guide/migrate-svn-repository-to-git 使用 git svn init 命令初始化无分支的 SVN 仓库。 ```sh git svn init https://example.com/svn/repo ``` -------------------------------- ### GET 请求语法 - 中心版 Source: https://help.aliyun.com/zh/yunxiao/developer-reference/listmergerequests-query-the-list-of-merge-requests-old 使用 GET 请求查询合并请求列表,需替换 {domain} 为服务接入点,并携带个人访问令牌。 ```bash GET https://{domain}/oapi/v1/codeup/organizations/{organizationId}/mergeRequests ``` -------------------------------- ### 新建步骤命令 Source: https://help.aliyun.com/zh/yunxiao/user-guide/custom-step-flow-cli-subcommand-step 执行 flow step init 新建步骤,注意将 更换为自己的步骤标识,标识为整个云效唯一。 ```bash flow step init ``` -------------------------------- ### Region版请求语法 - GET 获取里程碑列表 Source: https://help.aliyun.com/zh/yunxiao/developer-reference/listmilestones Region版 API 请求语法,使用 GET 方法,路径中不包含 organizationId。 ```bash GET https://{domain}/oapi/v1/projex/projects/{id}/milestones ``` -------------------------------- ### Response Example Source: https://help.aliyun.com/zh/yunxiao/developer-reference/createdirectory JSON response returned after successfully creating a test case directory. Contains the directory id, name, and parentId. ```json { "id": "testcase-directory-id-xxx", "name": "testcase-directory-name-xxx", "parentId": "testcase-directory-parent-id-xxx" } ``` -------------------------------- ### curl request example for Region edition Source: https://help.aliyun.com/zh/yunxiao/developer-reference/listappreleasestageruns Example curl command for the Region edition, which omits the organizationId path parameter. Includes the same query parameters and x-yunxiao-token header as the Central edition example. ```bash curl -X 'GET' \ 'https://{domain}/oapi/v1/appstack/apps/my-web-service/releaseWorkflows/3f472a12b15d4f418ad6227bb85f787c/releaseStages/6b4c53eee9a842c6a11235b29d002a81/executions?pagination=keyset&perPage=20&orderBy=id&sort=asc&nextToken=token&page=1' \ -H 'Content-Type: application/json' \ -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' ``` -------------------------------- ### 初始化 Codeup-CLI 配置文件 Source: https://help.aliyun.com/zh/yunxiao/user-guide/migrate-self-built-gitlab-to-region-station 执行 ./codeup-cli init 命令初始化配置文件,成功后输出 config.yaml 路径。 ```shell ./codeup-cli init ``` ```shell demo:workspace my$ ./codeup-cli init 【成功】 初始化 config.yaml 成功,路径地址为 /Users/my/config.yaml,请按照帮助文档正确填写配置。 ``` -------------------------------- ### Maven 查看有效 settings 配置命令 Source: https://help.aliyun.com/zh/yunxiao/user-guide/faq-13 在本地运行此命令,通过日志查看私库地址是否已经配置到 settings.xml 中,用于验证本地 Maven 配置是否正确。 ```bash mvn help:effective-settings ``` -------------------------------- ### Install required dependencies on Windows build machine Source: https://help.aliyun.com/zh/yunxiao/user-guide/windows-build-deployment List of tools to install on the Windows build server: Visual Studio 2022, Web Deploy installer, and .NET SDK. Choose versions as needed. ```plaintext Visual Studio 2022 webdeploy_amd64_zh-CN.msi dotnet-sdk-6.0.202-win-x64.exe ``` -------------------------------- ### flow-cli step init 初始化模板 step.yaml Source: https://help.aliyun.com/zh/yunxiao/user-guide/v2-step-yaml-description-language 这是 flow-cli step init 生成的步骤YAML模板,定义了步骤的基本信息、执行配置和参数列表。参数类型包括 input、password、textarea、select、checkbox,并展示了 showCondition 条件显示用法。 ```yaml --- apiVersion: V2 kind: DefaultJob id: FlowCustomStep name: 流水线自定义步骤 description: flow custom step demo helpUrl: https://atomgit.com/flow-step-custom/Test execution: executor: node main: dist/index.js items: - label: input 参数 name: abc type: input description: input 类型参数 abc value: hello world - label: password 参数 name: your_password type: password description: password 类型参数 your_password - label: textarea 参数 name: exclusion type: textarea value: | test/ build/ description: textarea 类型参数 exclusion - label: select 参数 name: select_version type: select value: v1.0.0 datasource: - label: "v1.0.0" value: v1.0.0 - label: "v1.0.1" value: v1.0.1 - label: "v1.0.2" value: v1.0.2 description: select 类型参数 select_version - label: 参数 edf name: edf type: input showCondition: ${select_version} == "v1.0.0" description: 配置 showCondition,只有当 select_version == v1.0.0 才展示 - label: 开关 name: toggle type: checkbox value: false ``` -------------------------------- ### 请求语法 - GET /repository/{repositoryId}/members/list Source: https://help.aliyun.com/zh/yunxiao/developer-reference/api-devops-2021-06-25-listrepositorymemberwithinherited 该接口使用 HTTP GET 方法,路径为 /repository/{repositoryId}/members/list,用于查询代码库成员列表,无分页。 ```HTTP GET /repository/{repositoryId}/members/list HTTP/1.1 ``` -------------------------------- ### Response example Source: https://help.aliyun.com/zh/yunxiao/developer-reference/create-a-new-work-item-association-test-case Example JSON response containing the id of the created test case relation record. ```json { "id": "id-xxx" } ``` -------------------------------- ### 环境变量组配置(生产环境) Source: https://help.aliyun.com/zh/yunxiao/user-guide/grayscale-release-based-on-nginx-ingress-cloud-effect-appstack 生产环境变量组的配置示例,设置namespace为demo-prod,host为go.demo.prod。 ```properties # namespace = demo-prod # host = go.demo.prod ``` -------------------------------- ### GET /oapi/v1/flow/organizations/{organizationId}/hostGroups (中心版) 和 GET /oapi/v1/flow/hostGroups (Region版) Source: https://help.aliyun.com/zh/yunxiao/developer-reference/listhostgroups 获取主机组列表。支持按 ID、名称、创建时间、创建人等条件筛选,并支持分页和排序。中心版需要 organizationId 路径参数,Region版不需要。 ```APIDOC ## [GET] /oapi/v1/flow/organizations/{organizationId}/hostGroups (中心版) 和 /oapi/v1/flow/hostGroups (Region版) ### Description 获取主机组列表。支持按 ID、名称、创建时间、创建人等条件筛选,并支持分页和排序。中心版需要 organizationId 路径参数,Region版不需要。 ### Method GET ### Endpoint 中心版: `https://{domain}/oapi/v1/flow/organizations/{organizationId}/hostGroups` Region版: `https://{domain}/oapi/v1/flow/hostGroups` ### Parameters #### Path Parameters - **organizationId** (string) - 中心版必填,Region版否 - 企业 Id。示例值: `5ebbc0228123212b59xxxxx` #### Query Parameters - **ids** (string) - 可选 - 主机组 id,多个逗号分割。示例值: `121,1212121232` - **name** (string) - 可选 - 主机组名称。示例值: `主机组` - **createStartTime** (integer) - 可选 - 主机组创建时间。示例值: `1586863220000` - **createEndTime** (integer) - 可选 - 主机组结束时间。示例值: `1586863220000` - **creatorAccountIds** (string) - 可选 - 创建阿里云账号 id,多个逗号分割。示例值: `1112122121,3223332` - **perPage** (integer) - 可选 - 每页数据条数,默认10,最大支持30。示例值: `10` - **page** (integer) - 可选 - 当前页,默认1。示例值: `1` - **pageSort** (string) - 可选 - 排序条件 ID。示例值: `ID` - **pageOrder** (string) - 可选 - 排序顺序 DESC 降序 ASC 升序。示例值: `DESC` #### Request Headers - **x-yunxiao-token** (string) - 必填 - 个人访问令牌。示例值: `pt-0fh3****0fbG_35af****0484` ### Request Example 中心版: ```bash curl -X 'GET' \ 'https://{domain}/oapi/v1/flow/organizations/5ebbc0228123212b59xxxxx/hostGroups?ids=121,1212121232&name=主机组&createStartTime=1586863220000&createEndTime=1586863220000&creatorAccountIds=1112122121,3223332&perPage=10&page=1&pageSort=ID&pageOrder=DESC' \ -H 'Content-Type: application/json' \ -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' ``` Region版: ```bash curl -X 'GET' \ 'https://{domain}/oapi/v1/flow/hostGroups?ids=121,1212121232&name=主机组&createStartTime=1586863220000&createEndTime=1586863220000&creatorAccountIds=1112122121,3223332&perPage=10&page=1&pageSort=ID&pageOrder=DESC' \ -H 'Content-Type: application/json' \ -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' ``` ### Response #### Success Response (200) - **aliyunRegion** (string) - 阿里云区域。示例值: `cn-hangzhou` - **createTime** (integer) - 创建时间。示例值: `1586863220000` - **creatorAccountId** (string) - 创建人。示例值: `1111111111111` - **description** (string) - 主机组描述。示例值: `主机组描述` - **ecsLabelKey** (string) - ecs 标签 Key。示例值: `ecs` - **ecsLabelValue** (string) - ecs 标签 Value。示例值: `ecs` - **ecsType** (string) - ecs 类型,暂只支持 ECS_ALIYUN。示例值: `ECS_ALIYUN` - **hostInfos** (array) - 主机信息列表。 - **aliyunRegion** (string) - 阿里云区域。示例值: `cn-hangzhou` - **createTime** (integer) - 创建时间。示例值: `1586863220000` - **creatorAccountId** (string) - 创建者阿里云账号。示例值: `1111111111111` - **instanceName** (string) - 主机名。示例值: `ceshi` - **ip** (string) - 机器 ip。示例值: `127.0.0.1` - **machineSn** (string) - 机器 sn。示例值: `1ssasa` - **modifierAccountId** (string) - 修改者阿里云账号。示例值: `1111111111111` - **objectType** (string) - MachineInfo 值固定为 MachineInfo。示例值: `MachineInfo` - **status** (string) - Runner 状态。示例值: `ok` - **updateTime** (integer) - 更新时间。示例值: `1586863220000` - **hostNum** (integer) - 主机数。示例值: `1` - **id** (integer) - 主机组 id。示例值: `1234` - **modifierAccountId** (string) - 更新人。示例值: `1111111111111` - **name** (string) - 主机组名称。示例值: `主机组名称` - **serviceConnectionId** (integer) - 服务连接 id。示例值: `1234` - **type** (string) - 主机组类型。示例值: `ECS` - **updateTime** (integer) - 更新时间。示例值: `1586863220000` - **uuid** (string) - 主机组 uuid。示例值: `KxqtcgPp7y5ROZdd` #### Response Example ```json [ { "aliyunRegion": "cn-hangzhou", "createTime": 1586863220000, "creatorAccountId": "1111111111111", "description": "主机组描述", "ecsLabelKey": "ecs", "ecsLabelValue": "ecs", "ecsType": "ECS_ALIYUN", "hostInfos": [ { "aliyunRegion": "cn-hangzhou", "createTime": 1586863220000, "creatorAccountId": "1111111111111", "instanceName": "ceshi", "ip": "127.0.0.1", "machineSn": "1ssasa", "modifierAccountId": "1111111111111", "objectType": "MachineInfo", "status": "ok", "updateTime": 1586863220000 } ], "hostNum": 1, "id": 1234, "modifierAccountId": "1111111111111", "name": "主机组名称", "serviceConnectionId": 1234, "type": "ECS", "updateTime": 1586863220000, "uuid": "KxqtcgPp7y5ROZdd" } ] ``` #### Response Headers - **x-next-page** (string) - 下一页。示例值: `3` - **x-page** (string) - 当前页。示例值: `2` - **x-per-page** (string) - 每页数据条数。示例值: `10` - **x-prev-page** (string) - 上一页。示例值: `1` - **x-total** (string) - 总数据量。示例值: `100` - **x-total-pages** (string) - 总分页数。示例值: `10` ### Error Codes 访问[错误码中心](https://help.aliyun.com/zh/yunxiao/developer-reference/error-code-center)查看 API 相关错误码。 ``` -------------------------------- ### sources..region example Source: https://help.aliyun.com/zh/yunxiao/user-guide/pipeline-sources Example YAML for configuring an ACR source with a region. Required for ACR sources. ```yaml sources: my_repo: type: acr region: cn-hangzhou instance: yunxiao namespace: default imageRepo: test imageTag: 2024-04-07-17-18-26-YAML certificate: type: serviceConnection serviceConnection: ``` -------------------------------- ### Linux Upstart 删除Runner服务 Source: https://help.aliyun.com/zh/yunxiao/user-guide/pipeline-runner 使用initctl停止Runner服务,禁用配置文件,并删除相关目录。如需删除所有租户的Runner服务,需额外执行rm -rf /root/yunxiao。 ```shell $ initctl stop $SERVICE_NAME $ mv /etc/init/$SERVICE_NAME.conf /etc/init/$SERVICE_NAME.conf.disabled $ rm -rf /root/yunxiao/$NAMESPACE #如果要删除该主机上的所有租户的Runner服务,除了对每个服务执行上述命令之外,在执行以下命令 $ rm -rf /root/yunxiao ``` -------------------------------- ### curl request example for Region edition Source: https://help.aliyun.com/zh/yunxiao/developer-reference/listorgdomains-query-the-list-of-enterprise-domain-names Example curl command for the Region edition, including the x-yunxiao-token header. ```bash curl -X 'GET' \ 'https://{domain}/oapi/v1/platform/domains' \ -H 'Content-Type: application/json' \ -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' ``` -------------------------------- ### 构建任务命令:配置NuGet源并拉取依赖 Source: https://help.aliyun.com/zh/yunxiao/use-cases/a-step-by-step-guide-to-net-application-development-with-apsara-devops 在构建任务中,使用此命令配置NuGet仓库凭证、拉取Newtonsoft.Json包并执行构建。注意替换凭证和URL为实际值。 ```bash # 配置 nuget 仓库凭证 dotnet nuget add source http://yunxiao-poc.devops.aliyuncs.com:80/packages/02e873bb-f911-48ac-ad73-ec2298c5385d/nuget/repo-hzaul/index.json -n repo-hzaul -u "xxxxxxxxxxx" -p "xxxxxxxxx" # 拉取 nuget 依赖包 dotnet add package Newtonsoft.Json --source http://yunxiao-poc.devops.aliyuncs.com:80/packages/02e873bb-f911-48ac-ad73-ec2298c5385d/nuget/repo-hzaul/index.json # mubuild 构建 dotnet msbuild /p:Configuration=Debug /t:Publish ``` -------------------------------- ### ListRepositories Example Response Source: https://help.aliyun.com/zh/yunxiao/developer-reference/api-devops-2021-06-25-listrepositories A normal response example for the ListRepositories API, showing the structure of the returned repository list. ```json { "requestId": "4D6AF7CC-B43B-5454-86AB-023D25E44868", "errorMessage": "\"\"", "total": 149, "success": true, "errorCode": 0, "result": [ { "lastActivityAt": "2022-01-14T21:08:26+08:00", "namespaceId": 745, "avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100", "starCount": 0, "archive": false, "createdAt": "2022-01-14T21:08:26+08:00", "star": false, "importStatus": "started", "webUrl": "\"\"", "description": "测试Codeup托管", "nameWithNamespace": "codeup-test-org / test-codeup(斜杠两侧有空格)", "pathWithNamespace": "codeup-test-org/test-codeup", "path": "test-codeup", "visibilityLevel": "0", "accessLevel": 40, "updatedAt": "2022-01-14T21:08:26+08:00", "name": "codeupTest", "Id": 1 } ] } ``` -------------------------------- ### 配置 NPM 仓库凭证并推送制品 Source: https://help.aliyun.com/zh/yunxiao/user-guide/npm-artifact-management 在 NPM 配置页签下选择推送,先设置仓库凭证:执行 npm config set registry=<仓库地址> 指定 registry,再执行 npm login 并输入账号和密码完成登录,最后执行 npm publish 推送制品。 ```bash npm config set registry=<仓库地址> ``` ```bash npm login ``` ```bash npm publish ``` -------------------------------- ### CreateCommitWithMultipleFiles - Response Example Source: https://help.aliyun.com/zh/yunxiao/developer-reference/api-devops-2021-06-25-createcommitwithmultiplefiles Example of a successful response from the CreateCommitWithMultipleFiles API, showing the structure of the returned commit data. ```APIDOC ## CreateCommitWithMultipleFiles ### Description Creates a commit with multiple files in a code repository. This documentation covers the response structure for a successful commit creation. ### Response #### Success Response (200) - **requestId** (string) - The unique identifier for the API request. - **success** (boolean) - Indicates whether the request was successful. - **errorCode** (string) - Error code, empty string on success. - **errorMsg** (string) - Error message, "error" on failure. - **result** (object) - The created commit details. - **id** (string) - The commit ID. - **shortId** (string) - Short commit ID. - **title** (string) - Commit title. - **message** (string) - Commit message. - **authorName** (string) - Author name. - **authorEmail** (string) - Author email. - **authoredDate** (string) - Date and time of authorship. - **committerName** (string) - Committer name. - **committerEmail** (string) - Committer email. - **committedDate** (string) - Date and time of commit. - **parentIds** (array of strings) - Parent commit IDs. - **createdAt** (string) - Creation timestamp. - **author** (object) - Author details. - **id** (integer) - User ID. - **aliyunPk** (string) - Alibaba Cloud account ID. - **name** (string) - Display name. - **username** (string) - Username. - **email** (string) - Email address. - **state** (string) - Account state. - **avatarUrl** (string) - Avatar URL. - **websiteUrl** (string) - Website URL. - **committer** (object) - Committer details. - **id** (integer) - User ID. - **aliyunPk** (string) - Alibaba Cloud account ID. - **name** (string) - Display name. - **username** (string) - Username. - **email** (string) - Email address. - **state** (string) - Account state. - **avatarUrl** (string) - Avatar URL. - **websiteUrl** (string) - Website URL. #### Response Example ```json { "requestId": "A7586FEB-E48D-5579-983F-74981FBFF627", "success": true, "errorCode": "\"\"", "errorMsg": "error", "result": { "id": "de02b625ba8488f92eb204bcb3773a40c1b4ddac", "shortId": "de02b625", "title": "提交标题", "message": "具体的提交内容", "authorName": "test-codeup", "authorEmail": "username@example.com", "authoredDate": "2022-03-18 15:00:00", "committerName": "committer-codeup", "committerEmail": "username@example.com", "committedDate": "2022-03-18 16:00:00", "parentIds": [ "ff4fb5ac6d1f44f452654336d2dba468ae6c8d04 " ], "createdAt": "2022-03-18 14:24:54", "author": { "id": 19927, "aliyunPk": "1234567890", "name": "test-codeup", "username": "test-codeup", "email": "username@example.com", "state": "active", "avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c4ef67f1bea827c4/w/100/h/100", "websiteUrl": "\"\"" }, "committer": { "id": 24661, "aliyunPk": "1234567890", "name": "committer-codeup", "username": "committer-codeup", "email": "username@example.com", "state": "active", "avatarUrl": "https://tcs-devops.aliyuncs.com/thumbnail/112afcb7a6a35c3f67f1bea827c4/w/100/h/100", "websiteUrl": "\"\"" } } } ``` ### Error Codes For more error codes, visit the [Error Center](https://api.aliyun.com/document/devops/2021-06-25/errorCode). ### Change History For more information, refer to the [Change Details](https://api.aliyun.com/document/devops/2021-06-25/CreateCommitWithMultipleFiles#workbench-doc-change-demo). ``` -------------------------------- ### 查看支持的 OpenAPI 列表:aliyun devops --help Source: https://help.aliyun.com/zh/yunxiao/developer-reference/how-to-install-initialize-and-use-the-apsara-devops-cli 使用 --help 选项查看云效 CLI 支持的全部命令列表。输出结果(部分)展示了命令用法和可用命令列表。 ```bash aliyun devops --help ``` ```plaintext Description: Aliyun CLI plugin for yunxiao operations. Usage: aliyun devops [flags] Available Commands: app-stack-create-application 创建应用 app-stack-list-applications 获取应用列表 codeup-create-repository 创建代码仓库 codeup-list-repositories 获取代码仓库列表 flow-create-pipeline 创建流水线 flow-list-pipelines 获取流水线列表 flow-get-flow-tag-group 获取流水线标签组详情 projex-search-projects 搜索项目 projex-search-workitems 搜索工作项 ... ``` -------------------------------- ### 初始化生成的文件结构 Source: https://help.aliyun.com/zh/yunxiao/user-guide/custom-step-flow-cli-subcommand-step 该命令会在本地创建 .step 目录和 目录,包含 entry.sh、Dockerfile、step.sh、step.yaml 等文件。 ```javascript .step |- .. |- entry.sh # 步骤需要的基础脚本 |- Dockerfile # 用于构建步骤镜像 |- step.sh # 步骤执行脚本 |- step.yaml # 用于描述步骤所有信息的 yaml ``` -------------------------------- ### sources..instance example Source: https://help.aliyun.com/zh/yunxiao/user-guide/pipeline-sources Example YAML for configuring an ACR source with an instance name. Required for ACR sources. ```yaml sources: my_repo: type: acr region: cn-hangzhou instance: yunxiao namespace: default imageRepo: test imageTag: 2024-04-07-17-18-26-YAML certificate: type: serviceConnection serviceConnection: ``` -------------------------------- ### 主机部署脚本:解压制品并重启应用 Source: https://help.aliyun.com/zh/yunxiao/user-guide/build-and-deploy-a-java-application-to-an-ecs-host 在主机部署任务中填写此部署脚本,用于解压构建产物并执行 deploy.sh 重启应用。脚本假定制品已下载到 /home/admin/app/package.tgz,解压到 /home/admin/application/ 后执行 restart 命令。 ```bash mkdir -p /home/admin/application tar zxvf /home/admin/app/package.tgz -C /home/admin/application/ sh /home/admin/application/deploy.sh restart ``` -------------------------------- ### sources..artifact example Source: https://help.aliyun.com/zh/yunxiao/user-guide/pipeline-sources Example YAML for configuring a packages source with an artifact name. Required for packages sources. ```yaml sources: my_repo: type: packages repoType: generic repo: flow_generic_repo artifact: Artifacts_1418394 version: 2024-03-28-11-53-39 certificate: type: serviceConnection serviceConnection: ``` -------------------------------- ### 验证Codeup-CLI工具运行(--help) Source: https://help.aliyun.com/zh/yunxiao/user-guide/install-the-local-migration-tool 在命令行执行./codeup-cli --help以确认工具运行正常。 ```sh ./codeup-cli --help ``` -------------------------------- ### sources..repo example Source: https://help.aliyun.com/zh/yunxiao/user-guide/pipeline-sources Example YAML for configuring a packages source with a repository ID. Required for packages sources. ```yaml sources: my_repo: type: packages repoType: generic repo: flow_generic_repo artifact: Artifacts_1418394 version: 2024-03-28-11-53-39 certificate: type: serviceConnection serviceConnection: ``` -------------------------------- ### sources..repoType example Source: https://help.aliyun.com/zh/yunxiao/user-guide/pipeline-sources Example YAML for configuring a packages source with repoType generic. Required for packages sources. ```yaml sources: my_repo: type: packages repoType: generic repo: flow_generic_repo artifact: Artifacts_1418394 version: 2024-03-28-11-53-39 certificate: type: serviceConnection serviceConnection: ``` -------------------------------- ### Maven构建命令指定settings.xml Source: https://help.aliyun.com/zh/yunxiao/user-guide/maven-dependency-and-upload-to-private-server 在代码库根目录放置settings.xml文件后,需要在构建命令中指定该文件。此命令使用 -s 参数加载自定义的settings.xml配置。 ```bash mvn -s settings.xml clean package ```