Skip to content

Commit

Permalink
vendor deps
Browse files Browse the repository at this point in the history
  • Loading branch information
fmenezes committed Aug 27, 2024
1 parent 4a88602 commit 1cb3ee1
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ gen-docs: ## Generate docs for atlascli commands
.PHONY: build
build: ## Generate an atlas binary in ./bin
@echo "==> Building $(ATLAS_BINARY_NAME) binary"
go build -ldflags "$(ATLAS_LINKER_FLAGS)" -o $(ATLAS_DESTINATION) $(ATLAS_SOURCE_FILES)
go build -ldflags "$(ATLAS_LINKER_FLAGS)" $(BUILD_FLAGS) -o $(ATLAS_DESTINATION) $(ATLAS_SOURCE_FILES)

.PHONY: build-debug
build-debug: ## Generate a binary in ./bin for debugging atlascli
@echo "==> Building $(ATLAS_BINARY_NAME) binary for debugging"
go build -gcflags="$(DEBUG_FLAGS)" -ldflags "$(ATLAS_LINKER_FLAGS)" -o $(ATLAS_DESTINATION) $(ATLAS_SOURCE_FILES)
go build -gcflags="$(DEBUG_FLAGS)" -ldflags "$(ATLAS_LINKER_FLAGS)" $(BUILD_FLAGS) -o $(ATLAS_DESTINATION) $(ATLAS_SOURCE_FILES)

.PHONY: e2e-test
e2e-test: build ## Run E2E tests
Expand Down
61 changes: 53 additions & 8 deletions build/ci/evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,29 @@ functions:
params:
<<: *go_options
command: make build
"vendor deps":
- command: subprocess.exec
params:
<<: *go_options
binary: go
args:
- mod
- vendor
- command: subprocess.exec
params:
<<: *go_options
binary: tar
args:
- czf
- vendor.tar.gz
- vendor
- command: subprocess.exec
params:
<<: *go_options
binary: rm
args:
- -rf
- vendor
"install mongodb database tools":
- command: shell.exec
type: setup
Expand Down Expand Up @@ -1497,27 +1520,34 @@ tasks:
vars:
host: ${public_ip_address}
user: atlascli
identity_file: ~/.ssh/id_rsa
identity_file: ${workdir}/.ssh/id_rsa
- func: "copy to remote"
vars:
local_dir: src/github.com/mongodb/mongodb-atlas-cli/build/ci/win_test.ps1
remote_dir: C:\\Users\\atlascli\\win_test.ps1
user: atlascli
host: ${public_ip_address}
identity_file: ~/.ssh/id_rsa
identity_file: ${workdir}/.ssh/id_rsa
- func: "copy to remote"
vars:
local_dir: src/github.com/mongodb/mongodb-atlas-cli/vendor.tar.gz
remote_dir: C:\\Users\\atlascli\\vendor.tar.gz
user: atlascli
host: ${public_ip_address}
identity_file: ${workdir}/.ssh/id_rsa
- func: "ssh"
vars:
host: ${public_ip_address}
user: atlascli
identity_file: ~/.ssh/id_rsa
identity_file: ${workdir}/.ssh/id_rsa
cmd: "powershell -NonInteractive -ExecutionPolicy Bypass -File C:\\Users\\atlascli\\win_test.ps1 ${go_proxy}"
- func: "copy from remote"
vars:
local_dir: src/github.com/mongodb/mongodb-atlas-cli/e2e-tests.xml
remote_dir: C:\\Users\\atlascli\\mongodb-atlas-cli\\e2e-tests.xml
user: atlascli
host: ${public_ip_address}
identity_file: ~/.ssh/id_rsa
identity_file: ${workdir}/.ssh/id_rsa
- name: atlas_deployments_windows_10
tags: ["e2e","deployments","windows"]
must_have_test_results: true
Expand All @@ -1530,36 +1560,51 @@ tasks:
vars:
host: ${public_ip_address}
user: atlascli
identity_file: ~/.ssh/id_rsa
identity_file: ${workdir}/.ssh/id_rsa
- func: "copy to remote"
vars:
local_dir: src/github.com/mongodb/mongodb-atlas-cli/build/ci/win_test.ps1
remote_dir: C:\\Users\\atlascli\\win_test.ps1
user: atlascli
host: ${public_ip_address}
identity_file: ~/.ssh/id_rsa
identity_file: ${workdir}/.ssh/id_rsa
- func: "copy to remote"
vars:
local_dir: src/github.com/mongodb/mongodb-atlas-cli/vendor.tar.gz
remote_dir: C:\\Users\\atlascli\\vendor.tar.gz
user: atlascli
host: ${public_ip_address}
identity_file: ${workdir}/.ssh/id_rsa
- func: "ssh"
vars:
host: ${public_ip_address}
user: atlascli
identity_file: ~/.ssh/id_rsa
identity_file: ${workdir}/.ssh/id_rsa
cmd: "powershell -ExecutionPolicy Bypass -File C:\\Users\\atlascli\\win_test.ps1 ${go_proxy}"
- func: "copy from remote"
vars:
local_dir: src/github.com/mongodb/mongodb-atlas-cli/e2e-tests.xml
remote_dir: C:\\Users\\atlascli\\mongodb-atlas-cli\\e2e-tests.xml
user: atlascli
host: ${public_ip_address}
identity_file: ~/.ssh/id_rsa
identity_file: ${workdir}/.ssh/id_rsa
task_groups:
- name: atlas_deployments_windows_group
setup_task:
- func: clone
- func: "vendor deps"
- func: "install terraform"
- func: "install azure cli"
- func: "login azure cli"
- func: "terraform init"
teardown_task:
- command: subprocess.exec
params:
<<: *go_options
binary: rm
args:
- -rf
- vendor.tar.gz
- func: "terraform destroy"
tasks:
- .e2e .deployments .windows
Expand Down
7 changes: 3 additions & 4 deletions build/ci/win_test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ cd $env:HOME
git clone "http://github.com/mongodb/mongodb-atlas-cli.git"
cd "mongodb-atlas-cli"
git checkout CLOUDP-265394
Write-Output "Debug"
Write-Output "Vendor dependencies"
$env:GOPROXY=$args[0]
go env
Write-Output "Download dependencies"
go mod download
tar -xzf ../vendor.tar.gz
Write-Output "Run tests"
$env:TEST_CMD="gotestsum --junitfile e2e-tests.xml --format standard-verbose --"
$env:E2E_TAGS="atlas,deployments,local,auth,noauth,nocli"
$env:BUILD_FLAGS="-mod vendor -x"
make e2e-test

0 comments on commit 1cb3ee1

Please sign in to comment.