Skip to content

Commit 683ff47

Browse files
authored
feat(CodeArts/Build): support resource build task (#7102)
1 parent 8f97091 commit 683ff47

File tree

8 files changed

+1340
-0
lines changed

8 files changed

+1340
-0
lines changed

docs/resources/codearts_build_task.md

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
---
2+
subcategory: "CodeArts Build"
3+
layout: "huaweicloud"
4+
page_title: "HuaweiCloud: huaweicloud_codearts_build_task"
5+
description: |-
6+
Manages a CodeArts Build task resource within HuaweiCloud.
7+
---
8+
9+
# huaweicloud_codearts_build_task
10+
11+
Manages a CodeArts Build task resource within HuaweiCloud.
12+
13+
## Example Usage
14+
15+
```hcl
16+
variable "codearts_project_id" {}
17+
variable "name" {}
18+
variable "url" {}
19+
variable "web_url" {}
20+
variable "scm_type" {}
21+
variable "repo_id" {}
22+
23+
resource "huaweicloud_codearts_build_task" "test" {
24+
project_id = var.codearts_project_id
25+
name = var.name
26+
arch = "x86-64"
27+
28+
scms {
29+
url = var.url
30+
scm_type = var.scm_type
31+
web_url = var.web_url
32+
repo_id = var.repo_id
33+
branch = "master"
34+
}
35+
}
36+
```
37+
38+
## Argument Reference
39+
40+
The following arguments are supported:
41+
42+
* `region` - (Optional, String, ForceNew) Specifies the region in which to create the resource.
43+
If omitted, the provider-level region will be used.
44+
Changing this creates a new resource.
45+
46+
* `project_id` - (Required, String, NonUpdatable) Specifies the CodeArts project ID.
47+
Changing this creates a new resource.
48+
49+
* `arch` - (Required, String) Specifies the architecture of the build machine.
50+
51+
* `name` - (Required, String) Specifies the name of the build task.
52+
53+
* `scms` - (Optional, List) Specifies the build execution SCM.
54+
The [scms](#block--scms) structure is documented below.
55+
56+
* `auto_update_sub_module` - (Optional, String) Specifies whether to automatically update submodules.
57+
58+
* `build_config_type` - (Optional, String) Specifies the build task configuration type.
59+
60+
* `build_if_code_updated` - (Optional, Bool) Specifies whether to enable the code commit trigger build switch.
61+
Defaults to **false**.
62+
63+
* `flavor` - (Optional, String) Specifies the specification of the execution machine.
64+
65+
* `group_id` - (Optional, String) Specifies the task group ID.
66+
67+
* `host_type` - (Optional, String) Specifies the host type.
68+
69+
* `parameters` - (Optional, List) Specifies the build execution parameter list.
70+
The [parameters](#block--parameters) structure is documented below.
71+
72+
* `steps` - (Optional, List) Specifies the build execution steps.
73+
The [steps](#block--steps) structure is documented below.
74+
75+
* `triggers` - (Optional, List) Specifies the collection of timed task triggers.
76+
The [triggers](#block--triggers) structure is documented below.
77+
78+
<a name="block--parameters"></a>
79+
The `parameters` block supports:
80+
81+
* `name` - (Optional, String) Specifies the parameter definition name.
82+
Defaults to **hudson.model.StringParameterDefinition**.
83+
84+
* `params` - (Optional, List) Specifies the build execution sub-parameters.
85+
The [params](#block--parameters--params) structure is documented below.
86+
87+
<a name="block--parameters--params"></a>
88+
The `params` block supports:
89+
90+
* `limits` - (Optional, List) Specifies the enumeration parameter restrictions.
91+
The [limits](#block--parameters--params--limits) structure is documented below.
92+
93+
* `name` - (Optional, String) Specifies the parameter field name.
94+
95+
* `value` - (Optional, String) Specifies the parameter field value.
96+
97+
<a name="block--parameters--params--limits"></a>
98+
The `limits` block supports:
99+
100+
* `disable` - (Optional, String) Specifies whether it is effective. Defaults to **0**, which is effective.
101+
102+
* `display_name` - (Optional, String) Specifies the displayed name of the parameter.
103+
104+
* `name` - (Optional, String) Specifies the parameter name.
105+
106+
<a name="block--scms"></a>
107+
The `scms` block supports:
108+
109+
* `repo_id` - (Required, String) Specifies the repository ID.
110+
111+
* `scm_type` - (Required, String) Specifies the source code management type.
112+
113+
* `url` - (Required, String) Specifies the repository URL.
114+
115+
* `web_url` - (Required, String) Specifies the web URL of the repository.
116+
117+
* `branch` - (Optional, String) Specifies the branch name.
118+
119+
* `build_type` - (Optional, String) Specifies the build type.
120+
121+
* `depth` - (Optional, String) Specifies the depth.
122+
123+
* `enable_git_lfs` - (Optional, Bool) Specifies whether to enable Git LFS. Defaults to **false**.
124+
125+
* `endpoint_id` - (Optional, String) Specifies the endpoint ID.
126+
127+
* `group_name` - (Optional, String) Specifies the group name.
128+
129+
* `is_auto_build` - (Optional, Bool) Specifies whether to automatically build. Defaults to **false**.
130+
131+
* `repo_name` - (Optional, String) Specifies the repository name.
132+
133+
* `source` - (Optional, String) Specifies the source type.
134+
135+
<a name="block--steps"></a>
136+
The `steps` block supports:
137+
138+
* `module_id` - (Required, String) Specifies the build step module ID.
139+
140+
* `name` - (Required, String) Specifies the build step name.
141+
142+
* `enable` - (Optional, Bool) Specifies whether to enable the step. Defaults to **false**.
143+
144+
* `properties` - (Optional, Map) Specifies the build step properties.
145+
146+
* `version` - (Optional, String) Specifies the build step version.
147+
148+
<a name="block--triggers"></a>
149+
The `triggers` block supports:
150+
151+
* `name` - (Required, String) Specifies the trigger type.
152+
153+
* `parameters` - (Required, List) Specifies the custom parameters.
154+
The [parameters](#block--triggers--parameters) structure is documented below.
155+
156+
<a name="block--triggers--parameters"></a>
157+
The `parameters` block supports:
158+
159+
* `name` - (Required, String) Specifies the parameter name.
160+
161+
* `value` - (Required, String) Specifies the parameter value.
162+
163+
## Attribute Reference
164+
165+
In addition to all arguments above, the following attributes are exported:
166+
167+
* `id` - The resource ID.
168+
169+
* `steps` - Specifies the build execution steps.
170+
The [steps](#attrblock--steps) structure is documented below.
171+
172+
<a name="attrblock--steps"></a>
173+
The `steps` block supports:
174+
175+
* `properties_all` - Specifies the build step properties.
176+
177+
## Import
178+
179+
The build task can be imported using `id`, e.g.
180+
181+
```bash
182+
$ terraform import huaweicloud_codearts_build_task.test <id>
183+
```

docs/resources/codearts_repository.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ In addition to all arguments above, the following attributes are exported:
114114

115115
* `update_at` - The last update time.
116116

117+
* `repository_id` - The repository primart key ID.
118+
117119
## Import
118120

119121
The repository can be imported using the `id`, e.g.

huaweicloud/config/endpoints.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,12 @@ var allServiceCatalog = map[string]ServiceCatalog{
956956
Product: "CodeArtsPipeline",
957957
},
958958

959+
"codearts_build": {
960+
Name: "cloudbuild-ext",
961+
Version: "v1",
962+
Product: "CodeArtsBuild",
963+
},
964+
959965
// catalog for Data Security Center
960966
"dsc": {
961967
Name: "sdg",

huaweicloud/provider.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import (
4545
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/services/cnad"
4646
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/services/coc"
4747
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/services/codearts"
48+
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/services/codeartsbuild"
4849
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/services/codeartsdeploy"
4950
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/services/codeartsinspector"
5051
"github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/services/codeartspipeline"
@@ -2725,6 +2726,8 @@ func Provider() *schema.Provider {
27252726
"huaweicloud_codearts_pipeline_template": codeartspipeline.ResourceCodeArtsPipelineTemplate(),
27262727
"huaweicloud_codearts_pipeline_service_endpoint": codeartspipeline.ResourceCodeArtsPipelineServiceEndpoint(),
27272728

2729+
"huaweicloud_codearts_build_task": codeartsbuild.ResourceCodeArtsBuildTask(),
2730+
27282731
"huaweicloud_dsc_instance": dsc.ResourceDscInstance(),
27292732
"huaweicloud_dsc_asset_obs": dsc.ResourceAssetObs(),
27302733
"huaweicloud_dsc_alarm_notification": dsc.ResourceAlarmNotification(),

0 commit comments

Comments
 (0)