-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.yml
190 lines (188 loc) · 5.64 KB
/
release.yml
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
# Copyright 2025 MongoDB Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
variables:
- &go_linux_version
go_root: "/opt/golang/go1.23"
go_bin: "/opt/golang/go1.23/bin"
go_base_path: ""
- &go_env
XDG_CONFIG_HOME: ${go_base_path}${workdir}
GO111MODULE: "on"
GOROOT: ${go_root}
GOPATH: ${go_base_path}${workdir}
ADD_PATH: "${go_bin}:${go_base_path}${workdir}/bin:${go_base_path}${workdir}/src/github.com/mongodb/atlas-cli-plugin-kubernetes/bin"
- &go_options
add_to_path:
- ${go_bin}
- ${go_base_path}${workdir}/bin
- ${go_base_path}${workdir}/src/github.com/mongodb/atlas-cli-plugin-kubernetes/bin
include_expansions_in_env:
- go_base_path
- workdir
working_dir: src/github.com/mongodb/atlas-cli-plugin-kubernetes
env:
<<: *go_env
functions:
"install gh-token":
- command: shell.exec
type: setup
params:
working_dir: src/github.com/mongodb/atlas-cli-plugin-kubernetes/bin
script: |
set -Eeou pipefail
curl --output gh-token -sfL https://github.com/Link-/gh-token/releases/download/v2.0.1/linux-amd64
chmod 755 ./gh-token
"install goreleaser":
- command: shell.exec
type: setup
params:
working_dir: src/github.com/mongodb/atlas-cli-plugin-kubernetes/bin
script: |
set -Eeou pipefail
curl -sfL ${goreleaser_pro_tar_gz} | tar zx
"install macos notarization service":
- command: shell.exec
type: setup
params:
working_dir: src/github.com/mongodb/atlas-cli-plugin-kubernetes
include_expansions_in_env:
- notary_service_url
script: |
set -Eeou pipefail
curl "${notary_service_url}" --output macos-notary.zip
unzip -u macos-notary.zip
chmod 755 ./linux_amd64/macnotary
"generate notices":
- command: subprocess.exec
type: test
params:
<<: *go_options
binary: build/package/generate-notices.sh
"package":
- command: github.generate_token
params:
expansion_name: github_token
- command: subprocess.exec
type: test
params:
<<: *go_options
env:
<<: *go_env
ARTIFACTORY_USERNAME: ${artifactory_username}
ARTIFACTORY_PASSWORD: ${artifactory_password}
GRS_USERNAME: ${garasign_username}
GRS_PASSWORD: ${garasign_password}
AUTHENTICODE_KEY_NAME: ${authenticode_key_name}
GITHUB_TOKEN: ${github_token}
include_expansions_in_env:
- go_base_path
- workdir
- notary_service_key_id
- notary_service_secret
- notary_service_url
- goreleaser_key
- version
binary: build/package/package.sh
"build-copybara":
- command: subprocess.exec
params:
<<: *go_options
binary: git
args:
- clone
- --depth=1
- https://github.com/google/copybara
- ${workdir}/copybara
- command: subprocess.exec
params:
<<: *go_options
binary: docker
args:
- build
- -t
- google/copybara
- ${workdir}/copybara
"run-copybara":
- command: shell.exec
params:
<<: *go_options
env:
<<: *go_env
TAG: ${tag}
GH_TOKEN: ${gh_token}
WORKFLOW: ${workflow}
EVERGREEN_USER: ${evergreen_user}
EVERGREEN_API_KEY: ${evergreen_api_key}
DOCS_SLACK_CHANNEL: ${docs_slack_channel}
working_dir: src/github.com/mongodb/atlas-cli-plugin-kubernetes/build/ci
shell: bash
script: |
./run-copybara.sh
tasks:
- name: package_goreleaser
tags: ["packaging"]
depends_on:
- name: compile
variant: "code_health"
commands:
- func: "generate notices"
- func: "install goreleaser"
- func: "install macos notarization service"
- func: "install gh-token"
- func: "package"
- name: copybara
depends_on:
- name: package_goreleaser
variant: release
commands:
- func: "build-copybara"
- command: github.generate_token
params:
expansion_name: docs_atlas_cli_token
owner: mongodb
repo: docs-atlas-cli
- func: "run-copybara"
vars:
gh_token: ${docs_atlas_cli_token}
workflow: docs-atlas-cli
- command: github.generate_token
params:
expansion_name: cloud_docs_token
owner: 10gen
repo: cloud-docs
- func: "run-copybara"
vars:
gh_token: ${cloud_docs_token}
workflow: cloud-docs
buildvariants:
- name: release
display_name: "Release AtlasCLI Plugin Kubernetes (goreleaser)"
git_tag_only: true
run_on:
- rhel90-small
expansions:
<<: *go_linux_version
server_version: "4.4.0-rc3"
package_name: "atlas-cli-plugin-kubernetes"
tasks:
- name: package_goreleaser
- name: copybara
display_name: "Copybara"
git_tag_only: true
run_on:
- ubuntu2404-small
expansions:
<<: *go_linux_version
tasks:
- name: copybara