Skip to content

chore: remove generate msi task #3926

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 39 commits into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
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
132 changes: 18 additions & 114 deletions build/ci/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ variables:
go_root: "/opt/golang/go1.24"
go_bin: "/opt/golang/go1.24/bin"
go_base_path: ""
- &go_windows_version
go_root: "c:\\golang\\go1.24"
go_bin: "c:\\golang\\go1.24\\bin"
go_base_path: "c:"
- &go_env
XDG_CONFIG_HOME: ${go_base_path}${workdir}
GO111MODULE: "on"
Expand Down Expand Up @@ -126,6 +122,7 @@ functions:
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
Expand All @@ -136,38 +133,6 @@ functions:
- goreleaser_key
- unstable
binary: build/package/package.sh
"install go-msi":
- command: subprocess.exec
type: setup
params:
working_dir: src/github.com/mongodb/mongodb-atlas-cli
command: choco install -y "go-msi" --force
"uninstall go-msi":
- command: subprocess.exec
type: setup
params:
working_dir: src/github.com/mongodb/mongodb-atlas-cli
command: choco uninstall -y "go-msi"
"generate msi":
- command: subprocess.exec
type: test
params:
<<: *go_options
add_to_path:
- ${go_bin}
- ${go_base_path}${workdir}/bin
- ${go_base_path}${workdir}/src/github.com/mongodb/mongodb-atlas-cli/bin
- "/cygdrive/c/Program Files/go-msi"
- "/cygdrive/c/wixtools/bin"
env:
<<: *go_env
SECRET_API_KEY: ${chocolatey_api_key}
ARTIFACTORY_USERNAME: ${artifactory_username}
ARTIFACTORY_PASSWORD: ${artifactory_password}
GRS_USERNAME: ${garasign_username}
GRS_PASSWORD: ${garasign_password}
unstable: ${unstable}
command: bash.exe -c build/package/generate-msi.sh
"rename pkg":
- command: subprocess.exec
type: test
Expand Down Expand Up @@ -368,74 +333,39 @@ functions:
shell: bash
script: |
./run-copybara.sh
"create-windows-host":
- command: host.create
params:
distro: windows-vsCurrent-small
- command: host.list
params:
wait: true
num_hosts: 1
path: ${workdir}/src/github.com/mongodb/mongodb-atlas-cli/build/ci/hosts.json
- command: shell.exec
params:
<<: *go_options
script: |
set -Eeou pipefail
echo "${__project_aws_ssh_key_value}" > ./build/ci/ssh_id
chmod 0600 ./build/ci/ssh_id
tasks:
- name: package_msi
tags: ["packaging"]
depends_on:
- name: compile
variant: "code_health"
commands:
- func: "install go-msi"
- func: "generate msi"
vars:
unstable: ${unstable}
- func: "uninstall go-msi"
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_files_include_filter:
- src/github.com/mongodb/mongodb-atlas-cli/bin/*.exe
- src/github.com/mongodb/mongodb-atlas-cli/dist/*.msi
remote_file: ${project}/dist/${revision}_${created_at}/unsigned_
bucket: mongodb-mongocli-build
permissions: public-read
content_type: ${content_type|application/octet-stream}
display_name: unsigned
- name: package_goreleaser
tags: ["packaging"]
depends_on:
- name: compile
variant: "code_health"
commands:
- func: "create-windows-host"
- func: "generate sbom"
- func: "run silkbomb"
- func: "generate notices"
- func: "install goreleaser"
- func: "install macos notarization service"
- func: "install gh-token"
- command: subprocess.exec
type: test
params:
working_dir: src/github.com/mongodb/mongodb-atlas-cli
include_expansions_in_env:
- project
- revision
- created_at
env:
BUCKET: mongodb-mongocli-build
unstable: ${unstable}
binary: build/package/download-win-binaries.sh
- command: subprocess.exec
type: test
params:
include_expansions_in_env:
- unstable
env:
ARTIFACTORY_USERNAME: ${artifactory_username}
ARTIFACTORY_PASSWORD: ${artifactory_password}
GRS_USERNAME: ${garasign_username}
GRS_PASSWORD: ${garasign_password}
AUTHENTICODE_KEY_NAME: ${authenticode_key_name}
working_dir: src/github.com/mongodb/mongodb-atlas-cli
binary: build/package/windows_notarize.sh
- func: "package"
vars:
unstable: ${unstable}
ARTIFACTORY_USERNAME: ${artifactory_username}
ARTIFACTORY_PASSWORD: ${artifactory_password}
GRS_USERNAME: ${garasign_username}
GRS_PASSWORD: ${garasign_password}
- func: "rename pkg"
vars:
unstable: ${unstable}
Expand Down Expand Up @@ -561,15 +491,6 @@ tasks:
gh_token: ${cloud_docs_token}
workflow: cloud-docs
buildvariants:
- name: go_atlascli_msi_snapshot
display_name: "Packaging AtlasCLI (go-msi)"
run_on:
- windows-vsCurrent-small
expansions:
<<: *go_windows_version
unstable: -unstable
tasks:
- name: package_msi
- name: goreleaser_atlascli_snapshot
display_name: "Packaging AtlasCLI (goreleaser)"
run_on:
Expand All @@ -584,9 +505,6 @@ buildvariants:
unstable: -unstable
tasks:
- name: package_goreleaser
depends_on:
- name: package_msi
variant: "go_atlascli_msi_snapshot"
- name: publish_atlascli_snapshot
display_name: "Publish AtlasCLI Snapshot"
run_on:
Expand All @@ -609,9 +527,6 @@ buildvariants:
meta_package_name: "mongodb-atlas"
tasks:
- name: package_goreleaser
depends_on:
- name: package_msi
variant: release_atlascli_msi
- name: copybara
display_name: "Copybara"
git_tag_only: true
Expand All @@ -623,17 +538,6 @@ buildvariants:
<<: *go_linux_version
tasks:
- name: copybara
- name: release_atlascli_msi
display_name: "Release AtlasCLI (go-msi)"
run_on:
- windows-vsCurrent-small
git_tag_only: true
tags:
- foliage_health
expansions:
<<: *go_windows_version
tasks:
- name: package_msi
- name: release_atlascli_publish
display_name: "Publish AtlasCLI Generator"
run_on:
Expand Down
65 changes: 65 additions & 0 deletions build/ci/ssh-ready.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/bash

# 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.

set -euo pipefail

declare -i attempts
declare -i connection_attempts
declare -ri timeout=10

while getopts 'i:h:t:u:' opt; do
case ${opt} in
i) keyfile="${OPTARG}" ;; # SSH identity file
u) user="${OPTARG}" ;; # Username on the remote host
h) hostsfile="${OPTARG}" ;; # Output of Evergreen host.list
t) connection_attempts="${OPTARG}" ;; # How many times to attempt to connect via SSH
*)
echo "Invalid option"
exit 1
;;
esac
done

hosts=$(
cat <<EOF | python - "$hostsfile"
import sys
import json
with open(sys.argv[1]) as hostsfile:
hosts = json.load(hostsfile)
for host in hosts:
print(host["dns_name"])
EOF
)

attempts=0
connection_attempts=${connection_attempts:-60} # Total timeout = timeout * timeout_attempts

for host in $hosts; do
set +e
echo "Waiting for $host to become available..."
while ! ssh -i "$keyfile" -o ConnectTimeout=10 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -tt "${user}@${host}" exit 2>/dev/null; do
if [[ "${attempts}" -ge "${connection_attempts}" ]]; then
echo 'Connect to spawn host failed'
exit 1
fi
((attempts++))

echo "SSH connection attempt $attempts/$connection_attempts failed. Retrying ($host)..."
# sleep for Permission denied (publickey) errors
sleep "$timeout"
done
set -e
done
9 changes: 6 additions & 3 deletions build/package/.goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@ builds:
- cmd: ./build/package/mac_notarize.sh
output: true
- <<: *build_defaults
builder: prebuilt
id: windows
goos: [windows]
goarch: [amd64]
goamd64: [v1]
prebuilt:
path: ./bin/atlas.exe
hooks:
post:
- cmd: ./build/package/windows_notarize.sh
output: true
- cmd: ./build/package/windows_build_msi.sh
output: true
gomod: # https://goreleaser.com/customization/verifiable_builds/
# Proxy a module from proxy.golang.org, making the builds verifiable.
# This will only be effective if running against a tag. Snapshots will ignore
Expand Down
42 changes: 0 additions & 42 deletions build/package/generate-msi.sh

This file was deleted.

31 changes: 31 additions & 0 deletions build/package/msi/generate-msi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
# Copyright 2020 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.

set -Eeou pipefail

GOROOT="$(cygpath --unix "c:\\golang\\go1.24")"
PATH="${PATH}:$(cygpath --unix "c:\\golang\\go1.24\\bin"):$(cygpath --unix "c:\\Program Files\\go-msi"):$(cygpath --unix "c:\\wixtools\\bin")"
GOCACHE="$(cygpath --unix "c:\\Users\\Administrator\\.cache")"
CGO_ENABLED=0

export GOROOT PATH GOCACHE CGO_ENABLED

choco install -y "go-msi" --force

go-msi make --path "wix.json" --msi "out.msi" --version "$(cat version.txt)"

choco uninstall -y "go-msi" --force

rm -rf "$GOCACHE"
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"guid": "cac1e5b1-6547-4c47-a68c-17a5b84dd87b",
"items": [
"bin/atlas.exe",
"build/package/msi/installer"
"installer"
]
},
"env": {
Expand Down
Loading
Loading