Skip to content

Commit fa256c3

Browse files
authored
CLOUDP-59277: Set up evergreen (#52)
1 parent d6d221c commit fa256c3

File tree

3 files changed

+35
-44
lines changed

3 files changed

+35
-44
lines changed

.evergreen.yml

Lines changed: 30 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,3 @@
1-
#####################################################
2-
# A note on expansions #
3-
#####################################################
4-
5-
# Expansions usually appear in the form ${key|default}
6-
# If 'key' is found in the executor's map of currently known
7-
# expansions, the corresponding value is used. If the key can
8-
# not be found, the default is used.
9-
#
10-
# Arbitrary expansions can be specified in the YAML configuration
11-
# files in the following places:
12-
# - The 'expansions' field for buildvariants (branch file)
13-
# - The 'expansions' field for distros (distros file)
14-
#
15-
# A number of 'built-in' expansions are also available for use; these include:
16-
# - environment variables available on the host machine
17-
# - 'workdir' (references the executor's work directory).
18-
# - 'task_id' (references the task id of the task the executor is working on).
19-
# - 'build_variant' (references the executing task's buildvariant).
20-
# - 'config_root' (references the root directory for the executor's configuration artifacts).
21-
221
stepback: true
232
command_type: system
243
pre_error_fails_task: true
@@ -28,19 +7,13 @@ pre_error_fails_task: true
287
ignore:
298
- "*.md"
309
- "*.txt"
31-
- "/dist/**"
32-
- "/bin/**"
33-
- "/third_party_notices/**"
3410

3511
variables:
3612
- &go_bin
37-
"/opt/golang/go1.13/bin"
38-
13+
"/opt/golang/go1.14/bin"
3914
- &go_options
4015
GO111MODULE: "on"
41-
GOFLAGS: "-mod=vendor"
42-
GOROOT: "/opt/golang/go1.13"
43-
16+
GOROOT: "/opt/golang/go1.14"
4417
functions:
4518
"clone":
4619
- command: git.get_project
@@ -53,20 +26,34 @@ functions:
5326
params:
5427
add_to_path:
5528
- *go_bin
56-
- *go_bin
5729
working_dir: mongocli
5830
env:
5931
WORKDIR: ${workdir}
6032
<<: *go_options
6133
command: make build
62-
"package":
63-
- command: subprocess.exec
34+
"gen-notices":
35+
- command: shell.exec
6436
type: setup
6537
params:
66-
env:
67-
WORKDIR: ${workdir}
68-
<<: *go_options
69-
command: "curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh"
38+
working_dir: mongocli
39+
script: |
40+
set -ex
41+
export GOROOT="/opt/golang/go1.14"
42+
mkdir go-licenses
43+
export GOPATH=${workdir}/go-licenses
44+
export PATH="$GOPATH/bin:$GOROOT/bin:$PATH"
45+
46+
go get -u github.com/google/go-licenses
47+
go-licenses save "github.com/mongodb/mongocli" --save_path=third_party_notices
48+
"fetch goreleaser":
49+
- command: shell.exec
50+
type: setup
51+
params:
52+
working_dir: mongocli
53+
script: |
54+
set -ex
55+
curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | sh
56+
"package":
7057
- command: subprocess.exec
7158
type: setup
7259
params:
@@ -75,9 +62,8 @@ functions:
7562
- ./bin
7663
working_dir: mongocli
7764
env:
78-
WORKDIR: ${workdir}
7965
<<: *go_options
80-
command: make build
66+
command: make package
8167
tasks:
8268
- name: compile
8369
commands:
@@ -87,14 +73,15 @@ tasks:
8773
depends_on:
8874
- name: compile
8975
commands:
76+
- func: "clone"
77+
- func: "gen-notices"
78+
- func: "fetch goreleaser"
9079
- func: "package"
9180
buildvariants:
92-
- name: ubuntu
93-
display_name: Ubuntu
81+
- name: redhat
82+
display_name: RHEL7 Test
9483
run_on:
95-
- ubuntu1804-test
96-
expansions:
97-
test_flags: "blah blah"
84+
- rhel70-small
9885
tasks:
9986
- name: compile
10087
- name: package

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ The following is a short list of commands that can be run in the root of the pro
2929

3030
We provide a git pre-commit hook to format and check the code, to install it run `make link-git-hooks`
3131

32+
We run our some packaging and publishing tasks in [Evergreen](https://github.com/evergreen-ci/evergreen).
33+
3234
### Generating mocks
3335

3436
We use [mockgen](https://github.com/golang/mock) to handle mocking in our unit tests

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,13 @@ gen-notices: ## Generate 3rd party notices
8585
go-licenses save "github.com/mongodb/mongocli" --save_path=third_party_notices
8686

8787
.PHONY: package
88-
package: gen-notices ## Use goreleaser to generate builds and publish
88+
package: ## Use goreleaser to generate builds
89+
@echo "==> Packaging"
8990
goreleaser --skip-publish --rm-dist --snapshot
9091

9192
.PHONY: release
9293
release: gen-notices ## Use goreleaser to generate builds and publish
94+
@echo "==> Releasing"
9395
goreleaser --rm-dist
9496

9597
.PHONY: list

0 commit comments

Comments
 (0)