Skip to content

CLOUDP-234527 Remove mongocli 2nd followup #2706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ Review and replace command name and arguments depending on the command you are u
"mode": "auto",
"program": "${workspaceFolder}/cmd/atlas",
"env": {},
"buildFlags": "-ldflags '-X github.com/mongodb/mongodb-atlas-cli/internal/config.ToolName=atlascli'",
"args": [
"login"
]
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ATLAS_DESTINATION=./bin/$(ATLAS_BINARY_NAME)
ATLAS_INSTALL_PATH="${GOPATH}/bin/$(ATLAS_BINARY_NAME)"

LINKER_FLAGS=-s -w -X github.com/mongodb/mongodb-atlas-cli/internal/version.GitCommit=${MCLI_GIT_SHA}
ATLAS_LINKER_FLAGS=${LINKER_FLAGS} -X github.com/mongodb/mongodb-atlas-cli/internal/config.ToolName=atlascli -X github.com/mongodb/mongodb-atlas-cli/internal/version.Version=${ATLAS_VERSION}
ATLAS_LINKER_FLAGS=${LINKER_FLAGS} -X github.com/mongodb/mongodb-atlas-cli/internal/version.Version=${ATLAS_VERSION}
ATLAS_E2E_BINARY?=../../../bin/${ATLAS_BINARY_NAME}

DEBUG_FLAGS=all=-N -l
Expand Down
2 changes: 1 addition & 1 deletion build/ci/evergreen-generate-tasks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

set -Eeou pipefail

go run tools/genevergreen/main.go -tool_name "${tool_name:?}" -tasks "${task_type:?}" >tasks.json
go run tools/genevergreen/main.go -tasks "${task_type:?}" >tasks.json
3 changes: 1 addition & 2 deletions build/ci/evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ functions:
include_expansions_in_env:
- go_base_path
- workdir
- tool_name
- task_type
binary: build/ci/evergreen-generate-tasks.sh
- command: s3.put
Expand All @@ -137,7 +136,7 @@ functions:
aws_secret: ${aws_secret}
local_files_include_filter:
- src/github.com/mongodb/mongodb-atlas-cli/tasks.json
remote_file: ${project}/dist/${revision}_${created_at}/${tool_name}/${task_type}/
remote_file: ${project}/dist/${revision}_${created_at}/atlascli/${task_type}/
bucket: mongodb-mongocli-build
permissions: public-read
content_type: ${content_type|application/json}
Expand Down
33 changes: 4 additions & 29 deletions build/ci/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ functions:
- notary_service_secret
- notary_service_url
- goreleaser_key
- tool_name
- github_token
- unstable
binary: build/package/package.sh
Expand Down Expand Up @@ -108,7 +107,6 @@ functions:
- "/cygdrive/c/wixtools/bin"
env:
<<: *go_env
TOOL_NAME: ${TOOL_NAME}
SECRET_API_KEY: ${chocolatey_api_key}
ARTIFACTORY_USERNAME: ${artifactory_username}
ARTIFACTORY_PASSWORD: ${artifactory_password}
Expand All @@ -129,7 +127,6 @@ functions:
- latest_rpm
- package_name
- meta_package_name
- tool_name
binary: build/package/rename-pkg.sh
"send slack notification":
- command: subprocess.exec
Expand All @@ -143,7 +140,6 @@ functions:
- release_slack_channel
- revision
- created_at
- TOOL_NAME
- unstable
binary: build/package/send-slack-notification.sh
"generate download archive json":
Expand All @@ -156,7 +152,6 @@ functions:
- go_base_path
- workdir
- FEED_FILE_NAME
- TOOL_NAME
binary: ../build/package/generate-download-archive-manifest.sh
"upload dist":
- command: s3.put
Expand Down Expand Up @@ -197,7 +192,6 @@ functions:
- signing_auth_token_46
- signing_auth_token_50
- signing_auth_token_60
- tool_name
- arch
env:
<<: *go_env
Expand All @@ -214,7 +208,6 @@ functions:
- revision
- created_at
- image
- tool_name
working_dir: src/github.com/mongodb/mongodb-atlas-cli/build/package/docker
binary: ./docker-build.sh
"docker build meta":
Expand All @@ -226,7 +219,6 @@ functions:
- revision
- created_at
- image
- tool_name
working_dir: src/github.com/mongodb/mongodb-atlas-cli/build/package/docker/meta
binary: ./docker-build.sh
"powershell build":
Expand All @@ -237,7 +229,6 @@ functions:
- project
- revision
- created_at
- tool_name
- unstable
working_dir: src/github.com/mongodb/mongodb-atlas-cli/
binary: Powershell -File ./build/package/powershell/windows_post_package_test.ps1
Expand All @@ -264,7 +255,6 @@ tasks:
- func: "install go-msi"
- func: "generate msi"
vars:
TOOL_NAME: ${tool_name}
unstable: ${unstable}
- func: "uninstall go-msi"
- command: s3.put
Expand Down Expand Up @@ -297,14 +287,12 @@ tasks:
- revision
- created_at
env:
TOOL_NAME: ${tool_name}
BUCKET: mongodb-mongocli-build
unstable: ${unstable}
binary: build/package/download-win-binaries.sh
- func: "package"
vars:
unstable: ${unstable}
tool_name: ${tool_name}
ARTIFACTORY_USERNAME: ${artifactory_username}
ARTIFACTORY_PASSWORD: ${artifactory_password}
GRS_USERNAME: ${garasign_username}
Expand All @@ -316,36 +304,34 @@ tasks:
latest_rpm: ${latest_rpm}
package_name: ${package_name}
meta_package_name: ${meta_package_name}
tool_name: ${tool_name}
- command: archive.targz_pack
params:
target: src/github.com/mongodb/mongodb-atlas-cli/dist/${tool_name}-deb-x86_64.tgz
target: src/github.com/mongodb/mongodb-atlas-cli/dist/atlascli-deb-x86_64.tgz
source_dir: src/github.com/mongodb/mongodb-atlas-cli/dist/apt/x86_64
include:
- "*.deb"
- command: archive.targz_pack
params:
target: src/github.com/mongodb/mongodb-atlas-cli/dist/${tool_name}-deb-arm64.tgz
target: src/github.com/mongodb/mongodb-atlas-cli/dist/atlascli-deb-arm64.tgz
source_dir: src/github.com/mongodb/mongodb-atlas-cli/dist/apt/arm64
include:
- "*.deb"
- command: archive.targz_pack
params:
target: src/github.com/mongodb/mongodb-atlas-cli/dist/${tool_name}-rpm-x86_64.tgz
target: src/github.com/mongodb/mongodb-atlas-cli/dist/atlascli-rpm-x86_64.tgz
source_dir: src/github.com/mongodb/mongodb-atlas-cli/dist/yum/x86_64
include:
- "*.rpm"
- command: archive.targz_pack
params:
target: src/github.com/mongodb/mongodb-atlas-cli/dist/${tool_name}-rpm-aarch64.tgz
target: src/github.com/mongodb/mongodb-atlas-cli/dist/atlascli-rpm-aarch64.tgz
source_dir: src/github.com/mongodb/mongodb-atlas-cli/dist/yum/arm64
include:
- "*.rpm"
- func: "generate download archive json"
vars:
package_name: ${package_name}
FEED_FILE_NAME: "${package_name}.json"
TOOL_NAME: ${tool_name}
- func: "upload dist"
- command: s3.put
params:
Expand All @@ -369,30 +355,25 @@ tasks:
content_type: ${content_type|application/x-gzip}
display_name: downloads-center-
- func: "send slack notification"
vars:
TOOL_NAME: atlascli
- name: push_atlascli_generate
patchable: false
stepback: false
commands:
- func: "generate evergreen"
vars:
tool_name: atlascli
task_type: snapshot
- name: push_stable_atlascli_generate
git_tag_only: true
stepback: false
commands:
- func: "generate evergreen"
vars:
tool_name: atlascli
task_type: publish
- name: pkg_test_atlascli_generate
tags: [ "smoke-test", "atlascli", "pkg" ]
commands:
- func: "generate evergreen"
vars:
tool_name: atlascli
task_type: postpkg
- name: pkg_test_repo_atlascli
patchable: false
Expand All @@ -404,7 +385,6 @@ tasks:
commands:
- func: "generate evergreen"
vars:
tool_name: atlascli
task_type: repo
- name: pkg_test_windows
tags: [ "smoke-test", "windows" ]
Expand All @@ -415,15 +395,13 @@ tasks:
- func: "powershell build"
vars:
file: windows_post_package_test
tool_name: atlascli
buildvariants:
- name: go_atlascli_msi_snapshot
display_name: "Packaging AtlasCLI (go-msi)"
run_on:
- windows-vsCurrent-small
expansions:
<<: *go_windows_version
tool_name: "atlascli"
unstable: -unstable
tasks:
- name: package_msi
Expand All @@ -436,7 +414,6 @@ buildvariants:
server_version: "4.4.0-rc3"
package_name: "mongodb-atlas-cli"
meta_package_name: "mongodb-atlas"
tool_name: "atlascli"
latest_deb: ~latest
latest_rpm: .latest
unstable: -unstable
Expand All @@ -463,7 +440,6 @@ buildvariants:
server_version: "4.4.0-rc3"
package_name: "mongodb-atlas-cli"
meta_package_name: "mongodb-atlas"
tool_name: "atlascli"
tasks:
- name: package_goreleaser
depends_on:
Expand All @@ -476,7 +452,6 @@ buildvariants:
git_tag_only: true
expansions:
<<: *go_windows_version
tool_name: "atlascli"
tasks:
- name: package_msi
- name: release_atlascli_publish
Expand Down
5 changes: 1 addition & 4 deletions build/package/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ builds:
binary: bin/atlas
main: ./cmd/atlas
ldflags:
- -s -w -X github.com/mongodb/mongodb-atlas-cli/internal/version.Version={{.Version}} -X github.com/mongodb/mongodb-atlas-cli/internal/version.GitCommit={{.FullCommit}} -X github.com/mongodb/mongodb-atlas-cli/internal/config.ToolName=atlascli
- -s -w -X github.com/mongodb/mongodb-atlas-cli/internal/version.Version={{.Version}} -X github.com/mongodb/mongodb-atlas-cli/internal/version.GitCommit={{.FullCommit}}
id: linux
goos: [linux]
goarch: [amd64,arm64]
Expand All @@ -40,7 +40,6 @@ builds:
post:
- cmd: ./build/package/windows_notarize.sh
env:
- TOOL_NAME=atlascli
- VERSION={{ .Version }}
output: true
gomod: # https://goreleaser.com/customization/verifiable_builds/
Expand Down Expand Up @@ -136,8 +135,6 @@ signs:
- linux_archives
- linux_package
- mongodb-atlas
env:
- TOOL_NAME=atlascli
artifacts: all
output: true
release:
Expand Down
6 changes: 3 additions & 3 deletions build/package/curator-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ esac
set -Eeou pipefail

# Confirm package is there
echo "Confirm package is there https://s3.amazonaws.com/mongodb-mongocli-build/${project:?}/dist/${revision:?}_${created_at:?}/${tool_name:?}-${ext:?}-${arch:?}.tgz"
curl -fLO --show-error "https://s3.amazonaws.com/mongodb-mongocli-build/${project:?}/dist/${revision:?}_${created_at:?}/${tool_name:?}-${ext:?}-${arch:?}.tgz"
echo "Confirm package is there https://s3.amazonaws.com/mongodb-mongocli-build/${project:?}/dist/${revision:?}_${created_at:?}/atlascli-${ext:?}-${arch:?}.tgz"
curl -fLO --show-error "https://s3.amazonaws.com/mongodb-mongocli-build/${project:?}/dist/${revision:?}_${created_at:?}/atlascli-${ext:?}-${arch:?}.tgz"

# --version needs to match the mongodb server version to publish to the right repo
# 4.X goes to the 4.x repo
Expand All @@ -51,4 +51,4 @@ curator \
--edition "${edition:?}" \
--version "${server_version:?}" \
--arch "${arch:?}" \
--packages "https://s3.amazonaws.com/mongodb-mongocli-build/${project:?}/dist/${revision:?}_${created_at:?}/${tool_name:?}-${ext:?}-${arch:?}.tgz"
--packages "https://s3.amazonaws.com/mongodb-mongocli-build/${project:?}/dist/${revision:?}_${created_at:?}/atlascli-${ext:?}-${arch:?}.tgz"
4 changes: 2 additions & 2 deletions build/package/docker/docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

set -Eeou pipefail

VERSION="$(git tag --list "${tool_name:?}/v*" --sort=taggerdate | tail -1 | cut -d "v" -f 2)"
VERSION="$(git tag --list "atlascli/v*" --sort=taggerdate | tail -1 | cut -d "v" -f 2)"

FILE_EXT=deb
if [[ "${image-}" =~ "rpm" ]]; then
Expand All @@ -29,5 +29,5 @@ ENTRYPOINT=atlas
docker build \
--build-arg url="${URL-}" \
--build-arg entrypoint="${ENTRYPOINT-}" \
-t "${tool_name-}-${image-}" \
-t "atlascli-${image-}" \
-f "${image-}.Dockerfile" .
9 changes: 2 additions & 7 deletions build/package/docker/meta/docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@

set -Eeou pipefail

if [[ "${tool_name:?}" != atlascli ]]; then
echo "invalid tool '${tool_name:?}' expected 'atlascli'"
exit 1
fi

VERSION="$(git tag --list "${tool_name:?}/v*" --sort=taggerdate | tail -1 | cut -d "v" -f 2)"
VERSION="$(git tag --list "atlascli/v*" --sort=taggerdate | tail -1 | cut -d "v" -f 2)"

FILE_EXT=deb
if [[ "${image-}" =~ "rpm" ]]; then
Expand All @@ -35,5 +30,5 @@ docker build \
--build-arg url="${URL-}" \
--build-arg entrypoint="${ENTRYPOINT-}" \
--build-arg server_version="5.0" \
-t "${tool_name-}-${image-}" \
-t "atlascli-${image-}" \
-f "${image-}.Dockerfile" .
2 changes: 1 addition & 1 deletion build/package/download-win-binaries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export project
export revision
export created_at

VERSION_GIT="$(git tag --list "${TOOL_NAME:?}/v*" --sort=taggerdate | tail -1 | cut -d "v" -f 2)"
VERSION_GIT="$(git tag --list "atlascli/v*" --sort=taggerdate | tail -1 | cut -d "v" -f 2)"
VERSION_NAME="$VERSION_GIT"
if [[ "${unstable-}" == "-unstable" ]]; then
VERSION_NAME="$VERSION_GIT-next"
Expand Down
2 changes: 1 addition & 1 deletion build/package/generate-download-archive-manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.
set -Eeou pipefail

VERSION="$(git tag --list "${TOOL_NAME}/v*" --sort=taggerdate | tail -1 | cut -d "v" -f 2)"
VERSION="$(git tag --list "atlascli/v*" --sort=taggerdate | tail -1 | cut -d "v" -f 2)"

if [[ ${VERSION} =~ "-pre" ]]; then
echo "Skipping generate download center manifest for pre-release version: ${VERSION}"
Expand Down
6 changes: 3 additions & 3 deletions build/package/generate-msi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export CGO_ENABLED

go-msi check-env

VERSION_GIT="$(git tag --list "${TOOL_NAME:?}/v*" --sort=taggerdate | tail -1 | cut -d "v" -f 2)"
VERSION_GIT="$(git tag --list "atlascli/v*" --sort=taggerdate | tail -1 | cut -d "v" -f 2)"
VERSION_NAME="$VERSION_GIT"
if [[ "${unstable-}" == "-unstable" ]]; then
VERSION_NAME="$VERSION_GIT-next"
Expand All @@ -33,8 +33,8 @@ COMMIT=$(git log -n1 --format=format:"%H")
SOURCE_FILES=./cmd/atlas
PACKAGE_NAME=mongodb-atlas-cli_${VERSION_NAME}_windows_x86_64.msi
OUTPUT=./bin/atlas.exe
LINKER_FLAGS="-s -w -X github.com/mongodb/mongodb-atlas-cli/internal/version.Version=${VERSION_GIT} -X github.com/mongodb/mongodb-atlas-cli/internal/version.GitCommit=${COMMIT} -X github.com/mongodb/mongodb-atlas-cli/internal/config.ToolName=${TOOL_NAME:?}"
WIX_MANIFEST_FILE="./build/package/wix/${TOOL_NAME:?}.json"
LINKER_FLAGS="-s -w -X github.com/mongodb/mongodb-atlas-cli/internal/version.Version=${VERSION_GIT} -X github.com/mongodb/mongodb-atlas-cli/internal/version.GitCommit=${COMMIT}"
WIX_MANIFEST_FILE="./build/package/wix/atlascli.json"

env GOOS=windows GOARCH=amd64 go build \
-ldflags "${LINKER_FLAGS}" -o ${OUTPUT} "${SOURCE_FILES}"
Expand Down
2 changes: 1 addition & 1 deletion build/package/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export MACOS_NOTARY_SECRET=${notary_service_secret:?}
export GORELEASER_KEY=${goreleaser_key:?}
export VERSION_GIT

VERSION_GIT="$(git tag --list "${tool_name:?}/v*" --sort=taggerdate | tail -1 | cut -d "v" -f 2)"
VERSION_GIT="$(git tag --list "atlascli/v*" --sort=taggerdate | tail -1 | cut -d "v" -f 2)"

if [[ "${unstable-}" == "-unstable" ]]; then
# avoid race conditions on the notarization step by using `-p 1`
Expand Down
2 changes: 1 addition & 1 deletion build/package/powershell/windows_post_package_test.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Install current version of MongoDB Atlas CLI
$NewestVersion = git tag --list "${Env:TOOL_NAME}/v*" --sort=taggerdate | tail -1 | cut -d "v" -f 2
$NewestVersion = git tag --list "atlascli/v*" --sort=taggerdate | tail -1 | cut -d "v" -f 2
$PackageName = "mongodb-atlas-cli_${NewestVersion}_windows_x86_64.msi"
if("${Env:UNSTABLE}" -eq "-unstable") {
$PackageName = "mongodb-atlas-cli_${NewestVersion}-next_windows_x86_64.msi"
Expand Down
2 changes: 1 addition & 1 deletion build/package/rename-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

set -Eeou pipefail

VERSION="$(git tag --list "${tool_name:?}/v*" --sort=taggerdate | tail -1 | cut -d "v" -f 2)"
VERSION="$(git tag --list "atlascli/v*" --sort=taggerdate | tail -1 | cut -d "v" -f 2)"

if [[ "${unstable-}" == "-unstable" ]]; then
VERSION="${VERSION}-next"
Expand Down
Loading