-
Notifications
You must be signed in to change notification settings - Fork 682
/
ocibuild.conf
216 lines (214 loc) · 6.68 KB
/
ocibuild.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
runnerTag: latest
name: terraform-provider-oci
team: Terraform Provider OCI
phoneBookId: terraform
description: Terraform Provider OCI
majorversion: 0
minorversion: 1
shortversion: ${majorversion}.${minorversion}
snapshotVersion: ${shortversion}-SNAPSHOT
# BLD_NUMBER contains the build number of this build, which is automatically incremented for each successive build in each branch.
# BLD_BRANCH_SUFFIX is the branch name with a leading hyphen. For instance, if your branch name is foo, then the BLD_BRANCH_SUFFIX would be -foo.
# If your branch is master, the BLD_BRANCH_SUFFIX would be null.
version: ${shortversion}${?BLD_BRANCH_SUFFIX}.${BLD_NUMBER}
# A list of branch names, including special branch name 'pull-requests'. Determines which branches will trigger on
# commit to bitbucket.
triggerOnCommitBranches : ["*"]
# A list of branch names that should run all defined build steps including those which publish artifacts.
# If a branch is not included in the list, it will be a 'dry-run' build and skips any steps that push dependencies,
# runs scanners, or notifies other services, such as pipelines.
releaseBranches: ["publish_artifact"]
## Build Service Slack Notification ##
sendNotificationBranches: ["master", "provider_preview"]
slackChannels: ["#oci_rmsdp_provider"]
# Compartment id which build service will use to do authorization to restrict UI access in build service
authCompartmentOcid: "ocid1.compartment.oc1..aaaaaaaayowcmwbljnoub4fyirytbmpbksw5k4qvdegy6syxnmcqmufhgy7a"
pipelineId: "ocid1.devopsbuildpipeline.oc1.phx.amaaaaaajcdxrhqavdtcbbp4n5oootmo3gteqxvsgglmg3g3qlt3vfdg7roq"
steps:
[
{
name: git_clone
type: git
buildTimeout: 25
gitCloneType: "shallow"
cloneSubmodules: "true"
environment: {
"https_proxy": "http://www-proxy.us.oracle.com:80",
"http_proxy": "http://www-proxy.us.oracle.com:80",
"no_proxy": "127.0.0.0,localhost,us.oracle.com,oraclecorp.com"
}
artifacts: [ "**" ]
},
{
name: terraform_providers_linting
type: make
runnerImage: build-runner-python-ol8
dependsOn: [git_clone]
environment: {
"ENABLE_LINT_FOR_BACKWARD_COMPATIBILITY_FOR_ALL_RESOURCES": "false"
}
makeCommands:
[
{
target: "buildpyEnv"
}
]
compartmentOcid: "ocid1.compartment.oc1..aaaaaaaapq5mkp2y2umggvc3qx4wcdno3gxbhlrqp444ydwzhyjr46jj47cq"
secrets:
[
{
envVarName: "JIRA_USERNAME",
secretServicePath: "/secret/terraform-provider/jira_username/latest"
},
{
envVarName: "JIRA_PASSWORD",
secretServicePath: "/secret/terraform-provider/jirapassword/latest"
},
{
envVarName: "BITBUCKET_PASSWORD",
secretServicePath: "/secret/terraform-provider/bitbucketpassword/latest"
},
{
envVarName: "BITBUCKET_USERNAME",
secretServicePath: "/secret/terraform-provider/bitbucket_username/latest"
}
]
},
{
name: go_install
type: golang
dependsOn: [git_clone]
environment: {
"GOFLAGS": "-mod=vendor",
"GO111MODULE": "on"
}
goVersion: "1.21.5"
goCommands: [
{
command: "install"
}
]
artifacts: [
"**"
]
},
{
name: unit_test_with_code_coverage
type: golang
dependsOn: [git_clone]
environment: {
"GOFLAGS": "-mod=vendor",
"GO111MODULE": "on"
}
compartmentOcid: "ocid1.compartment.oc1..aaaaaaaapq5mkp2y2umggvc3qx4wcdno3gxbhlrqp444ydwzhyjr46jj47cq"
secrets: [
{ envVarName: "OCI_RESOURCE_PRINCIPAL_PRIVATE_PEM", secretServicePath: "secret/terraform-provider/unittest_oci_resource_principal_private_pem/latest"},
{ envVarName: "OCI_RESOURCE_PRINCIPAL_RPST", secretServicePath: "/secret/terraform-provider/unittest_oci_resource_principal_rpst/latest"}
]
goVersion: "1.21.5"
goCommands: [
{
command: "test ./..."
args: "-run TestUnit -coverprofile cover.out"
},
{
command: "tool cover"
args: "-html=cover.out -o coverage.html"
},
{
command: "tool cover"
args: "-func cover.out -o coverage/coverage.txt"
}
]
testCoverageLocation : "coverage/coverage.txt"
artifacts: [
"**"
]
},
{
dependsOn: unit_test_with_code_coverage
name: code_coverage_enforcement
type: golang
runnerImage: "build-runner-golang-boring-ssl"
environment: {
"CHECK_COVERAGE": "true"
}
goVersion: "1.21.5"
goCommands: [
{
command: "test coverage/coverage_test.go"
args: "-v -mod vendor"
}
]
artifacts: [
"**"
]
},
{
name: build-terraform-providers-amd64
dependsOn: [unit_test_with_code_coverage]
type: golang
goVersion: 1.21.5
environment:
{
"GOFLAGS": "-mod=vendor",
"GO111MODULE": "",
"GOARCH"="amd64",
"GOOS"="linux",
"CGO_ENABLED"="0"
}
goCommands:
[
{
command: "build",
args: "-v" "-ldflags='-s'" "-o linux_amd64/terraform-provider-oci_v"${version}
}
]
artifacts:
[
"linux_amd64/terraform-provider-oci_v"${version}
]
},
{
name: build-terraform-providers-arm64
dependsOn: [unit_test_with_code_coverage]
type: golang
goVersion: 1.21.5
environment:
{
"GOFLAGS": "-mod=vendor",
"GO111MODULE": "",
"GOARCH"="arm64",
"GOOS"="linux",
"CGO_ENABLED"="0"
}
goCommands:
[
{
command: "build",
args: "-v" "-ldflags='-s '" "-o linux_arm64/terraform-provider-oci_v"${version}
}
]
artifacts:
[
"linux_arm64/terraform-provider-oci_v"${version}
]
},
{
name: publish_shepherd_providers
dependsOn: [build-terraform-providers-amd64, build-terraform-providers-arm64]
type: publishGeneric
repository: odo-artifacts-signed-generic-local
filePathsToPublish:
[
{
localFile: "linux_amd64/terraform-provider-oci_v"${version},
targetDir: "shepherd/terraform-providers/linux_amd64"
},
{
localFile: "linux_arm64/terraform-provider-oci_v"${version},
targetDir: "shepherd/terraform-providers/linux_arm64"
}
]
}
]