cycloid/cycloid-resource本镜像为Concourse CI/CD平台提供专用资源支持,旨在集成并执行Cycloid平台的核心功能。通过该资源,用户可在Concourse流水线中自动化触发terracost(基础设施成本估算)和infrapolicy(基础设施策略检查)等Cycloid特性,实现部署前的成本管控与合规性验证。
在Concourse管道配置中声明资源类型,指定镜像来源:
yamlresource_types: - name: cycloid-resource type: docker-image source: repository: [镜像仓库地址] # 替换为实际镜像仓库路径 tag: [版本标签] # 如"latest"或具体版本号
定义资源实例,设置Cycloid连接参数:
yamlresources: - name: cycloid-feature-check type: cycloid-resource source: cycloid_api_url: https://[cycloid-instance].com # Cycloid实例API地址 cycloid_api_token: ((cycloid-api-token)) # 通过Concourse变量存储API令牌 timeout: "300s" # 可选,设置功能执行超时时间 log_level: "info" # 可选,设置日志级别(debug/info/warn/error)
在Job计划中通过get或put步骤触发功能执行:
yamljobs: - name: infrastructure-validation plan: - get: infrastructure-code # 获取基础设施代码(如Terraform文件) - get: cycloid-feature-check params: action: "terracost" # 指定执行功能:"terracost"或"infrapolicy" tf_plan_path: "./infrastructure-code/terraform.plan" # Terraform计划文件路径 policy_path: "./infrastructure-code/policy" # 策略文件路径(infrapolicy时需指定)
| 参数名 | 类型 | 描述 | 适用功能 | 是否必填 |
|---|---|---|---|---|
| cycloid_api_url | string | Cycloid平台API访问地址 | 所有 | 是 |
| cycloid_api_token | string | Cycloid平台API认证令牌 | 所有 | 是 |
| action | string | 执行动作,取值"terracost"或"infrapolicy" | 所有 | 是 |
| tf_plan_path | string | Terraform计划文件路径 | terracost | 是 |
| policy_path | string | 策略文件或目录路径 | infrapolicy | 是 |
| timeout | string | 执行超时时间(如"300s") | 所有 | 否 |
| log_level | string | 日志输出级别(debug/info/warn/error) | 所有 | 否 |
yamlresource_types: - name: cycloid-resource type: docker-image source: repository: cycloid/concourse-resource tag: latest resources: - name: terraform-code type: git source: uri: [***] branch: main - name: cycloid-checker type: cycloid-resource source: cycloid_api_url: [***] cycloid_api_token: ((cycloid-token)) log_level: "debug" jobs: - name: pre-deploy-validation plan: - get: terraform-code trigger: true - task: generate-tf-plan config: platform: linux image_resource: type: docker-image source: {repository: hashicorp/terraform, tag: 1.6.0} inputs: - name: terraform-code outputs: - name: tf-plan run: path: sh args: - -c - | cd terraform-code terraform init terraform plan -out=../tf-plan/terraform.plan - get: cycloid-checker params: action: "terracost" tf_plan_path: "./tf-plan/terraform.plan" - get: cycloid-checker params: action: "infrapolicy" policy_path: "./terraform-code/policy" tf_plan_path: "./tf-plan/terraform.plan"
manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务