Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into beta-releases
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jun 10, 2024
2 parents 5e2a1c0 + a0ad35d commit 8175a89
Show file tree
Hide file tree
Showing 85 changed files with 3,685 additions and 2,420 deletions.
34 changes: 34 additions & 0 deletions .evergreen/build-dev-release-info.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#! /usr/bin/env bash

set -e
set -x

if [[ "${EVERGREEN_PROJECT}" != "10gen-compass-main" ]]; then
echo "Trying to publish main compass (dev build) from ${EVERGREEN_PROJECT} project. Skipping...";
exit 0;
fi

if [[ "${EVERGREEN_BRANCH_NAME}" != "main" ]]; then
echo "Trying to publish main compass (dev build) from ${EVERGREEN_BRANCH_NAME} branch. Skipping...";
exit 0;
fi

JSON_CONTENT=$( jq -n \
--arg id "$DEV_VERSION_IDENTIFIER" \
--arg key "${EVERGREEN_REVISION}_${EVERGREEN_REVISION_ORDER_ID}" \
'{version: $id, bucket_key_prefix: $key}'
)

URL="https://mciuploads.s3.amazonaws.com/${EVERGREEN_PROJECT}/compass/dev/$1"
DATA=$(curl -sf "${URL}" || echo "$JSON_CONTENT")
CURRENT_VERSION=$(echo "$DATA" | jq -r '.version')

echo "Comparing versions: $CURRENT_VERSION and $DEV_VERSION_IDENTIFIER"
LATEST_VERSION=$(npx semver "$CURRENT_VERSION" "$DEV_VERSION_IDENTIFIER" | tail -n1 | xargs)

if [[ "$LATEST_VERSION" == "$CURRENT_VERSION" ]]; then
echo "Skipping publishing dev release, version $DEV_VERSION_IDENTIFIER is not newer than $CURRENT_VERSION"
exit 0
fi

echo "$JSON_CONTENT" > "$1"
2 changes: 1 addition & 1 deletion .evergreen/buildvariants.in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildvariants:
tasks:
- name: publish
- name: publish-packages-next
- name: publish-dev-release
- name: publish-dev-release-info

- name: ubuntu_connectivity_tests
display_name: Connectivity Tests
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/buildvariants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildvariants:
tasks:
- name: publish
- name: publish-packages-next
- name: publish-dev-release
- name: publish-dev-release-info

- name: ubuntu_connectivity_tests
display_name: Connectivity Tests
Expand Down
13 changes: 7 additions & 6 deletions .evergreen/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ variables:
EVERGREEN_IS_PATCH: ${is_patch}
EVERGREEN_PROJECT: ${project}
EVERGREEN_REVISION: ${revision}
EVERGREEN_REVISION_ORDER_ID: ${revision_order_id}
EVERGREEN_TASK_ID: ${task_id}
EVERGREEN_TASK_NAME: ${task_name}
EVERGREEN_TASK_URL: https://evergreen.mongodb.com/task/${task_id}
Expand Down Expand Up @@ -443,7 +444,7 @@ functions:
echo "Uploading release assets to S3 and GitHub if needed..."
npm run --workspace mongodb-compass upload
publish-dev-release:
publish-dev-release-info:
- command: shell.exec
params:
working_dir: src
Expand All @@ -452,14 +453,14 @@ functions:
<<: *compass-env
script: |
eval $(.evergreen/print-compass-env.sh)
.evergreen/publish-dev-release.sh LATEST
.evergreen/build-dev-release-info.sh release.json
- command: s3.put
params:
<<: *save-artifact-params-public
local_file: src/LATEST
remote_file: ${project}/compass/dev/LATEST
content_type: text/plain
display_name: LATEST
local_file: src/release.json
remote_file: ${project}/compass/dev/release.json
content_type: application/json
display_name: release.json
optional: true

get-packaged-app:
Expand Down
2 changes: 2 additions & 0 deletions .evergreen/print-compass-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ function printCompassEnv() {
printVar('DEBUG', process.env.DEBUG);
printVar('MONGODB_VERSION', process.env.MONGODB_VERSION || process.env.MONGODB_DEFAULT_VERSION);
printVar('DEV_VERSION_IDENTIFIER', process.env.DEV_VERSION_IDENTIFIER);
printVar('EVERGREEN_REVISION', process.env.EVERGREEN_REVISION);
printVar('EVERGREEN_REVISION_ORDER_ID', process.env.EVERGREEN_REVISION_ORDER_ID);
}

printCompassEnv();
21 changes: 0 additions & 21 deletions .evergreen/publish-dev-release.sh

This file was deleted.

4 changes: 2 additions & 2 deletions .evergreen/tasks.in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ tasks:
- func: install
- func: bootstrap
- func: publish-packages-next
- name: publish-dev-release
- name: publish-dev-release-info
tags: []
depends_on:
- name: 'publish'
variant: '*'
commands:
- func: prepare
- func: publish-dev-release
- func: publish-dev-release-info
<% for (const packageTask of tasks.package) { %>
- name: <% out(packageTask.name) %>
tags: ['required-for-publish', 'run-on-pr']
Expand Down
4 changes: 2 additions & 2 deletions .evergreen/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ tasks:
- func: install
- func: bootstrap
- func: publish-packages-next
- name: publish-dev-release
- name: publish-dev-release-info
tags: []
depends_on:
- name: 'publish'
variant: '*'
commands:
- func: prepare
- func: publish-dev-release
- func: publish-dev-release-info

- name: package-compass
tags: ['required-for-publish', 'run-on-pr']
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,4 @@ Alena Khineika <[email protected]>
Mingjun Yin <[email protected]>
Ben Radcliffe <[email protected]>
Betsy Button <[email protected]>
Vivian Xiao <[email protected]>
Loading

0 comments on commit 8175a89

Please sign in to comment.