stepback: false exec_timeout_secs: 5400 ## Variables variables: - &save-artifact command: s3.put params: aws_key: ${aws_key} aws_secret: ${aws_secret} bucket: mciuploads permissions: public-read content_type: application/octet-stream post: - &save-diagnostic-file <<: *save-artifact params: local_files_include_filter: - src/.deps/.npm/_logs/*.log remote_file: ${project}/${revision}/${build_variant}/${task_name} content_type: text/plain - <<: *save-diagnostic-file params: local_files_include_filter: - ~/.mongodb/runner/*.log functions: 'prepare': - command: git.get_project params: directory: src - &generate-compass-env command: shell.exec params: working_dir: src shell: bash script: | echo "Setting up ~/compass_env.sh" cat < ~/compass_env.sh export CI=1 export EVERGREEN=1 # Make default evergreen expansions accessible to hadron-build export EVERGREEN_ASSET_PREFIX="s3://mciuploads/${project}/${revision}"; export EVERGREEN_AUTHOR="${author}"; export EVERGREEN_AWS_ACCESS_KEY_ID="${aws_key}"; export EVERGREEN_AWS_SECRET_ACCESS_KEY="${aws_secret}"; export EVERGREEN_BRANCH_NAME="${branch_name}"; export EVERGREEN_BUILD_ID="${build_id}"; export EVERGREEN_BUILD_VARIANT="${build_variant}"; export EVERGREEN_EXECUTION="${execution}"; export EVERGREEN_IS_PATCH=${is_patch}; export EVERGREEN_PROJECT="${project}"; export EVERGREEN_REVISION="${revision}"; export EVERGREEN_TASK_ID="${task_id}"; export EVERGREEN_TASK_NAME="${task_name}"; export EVERGREEN_TASK_URL="https://evergreen.mongodb.com/task/${task_id}"; export EVERGREEN_VERSION_ID="${version_id}"; export EVERGREEN_WORKDIR="${workdir}"; export HADRON_METRICS_BUGSNAG_KEY="${metrics_bugsnag_key}"; export HADRON_METRICS_INTERCOM_APP_ID="${metrics_intercom_app_id}"; export HADRON_METRICS_STITCH_APP_ID="${metrics_stitch_app_id}"; # node stuff export ARTIFACTS_PATH="$(pwd)/.deps" export NPM_CACHE_DIR="$(pwd)/.deps/.npm" export NPM_TMP_DIR="$(pwd)/.deps/tmp" export NPM_AUTH_TOKEN="${compass_npm_token}" export NODE_JS_VERSION="12.4.0" # TODO: lucas: Go back to npm@latest after 6.13.4 released # or https://jira.mongodb.org/browse/COMPASS-4019 removes jade. # https://jira.mongodb.org/browse/COMPASS-4018 # export NPM_VERSION="latest" export NPM_VERSION="6.13.2" if [[ "$OSTYPE" == "cygwin" ]]; then # NOTE lucas: for git-core addition, See # https://jira.mongodb.org/browse/COMPASS-4122 export PATH="/cygdrive/c/Program Files/Git/mingw32/libexec/git-core/:$(pwd)/.deps:/cygdrive/c/wixtools/bin/:$PATH" export APPDATA=Z:\\\; fi if [[ "$OSTYPE" != "cygwin" ]]; then export PATH="$(pwd)/.deps/bin:$PATH" fi EOF_BUILD_SH source ~/compass_env.sh # Make all the dirs mkdir -p $ARTIFACTS_PATH mkdir -p $NPM_CACHE_DIR mkdir -p $NPM_TMP_DIR - command: shell.exec params: working_dir: src shell: bash script: | source ~/compass_env.sh echo "Configuring npm..." cat <> .npmrc devdir=$NPM_CACHE_DIR/.node-gyp init-module=$NPM_CACHE_DIR/.npm-init.js cache=$NPM_CACHE_DIR tmp=$NPM_TMP_DIR _authToken=$NPM_AUTH_TOKEN EOT - command: shell.exec params: working_dir: src shell: bash script: | set -e source ~/compass_env.sh bash .evergreen/preinstall.sh install: - command: shell.exec params: working_dir: src shell: bash script: | set -e source ~/compass_env.sh echo "Installing Compass dependencies..." echo "If npm ci fails, debug.log will be uploaded to S3." # We are running everything with --unsafe-perm because RHEL evergreen user is root npm ci --unsafe-perm # Make sure that cache is populated when other packages are pulling the font npm run update-akzidenz-cache --unsafe-perm # Run npm ci in all the packages npm run bootstrap-evergreen --unsafe-perm save: - command: shell.exec params: shell: bash script: | set -e tar -zcf compass-build.tgz ./src - <<: *save-artifact params: local_file: compass-build.tgz remote_file: ${project}/${revision}/${build_variant}/build.tgz restore: - &restore-fetch-s3 command: s3.get params: aws_key: ${aws_key} aws_secret: ${aws_secret} local_file: compass-build.tgz remote_file: ${project}/${revision}/${build_variant}/build.tgz bucket: mciuploads content_type: application/octet-stream - &restore-unpack-s3 command: shell.exec shell: bash params: script: | set -e tar xzf compass-build.tgz --strip-components=1 # TODO: lucas: may want to remove ./node_modules here before running npm ci like travis does? ls -alh - <<: *generate-compass-env verify: command: shell.exec params: working_dir: src shell: bash script: | set -e source ~/compass_env.sh echo "Run static analysis..." npm run check-evergreen test: - command: shell.exec params: working_dir: src shell: bash script: | set -e # Load environment variables source ~/compass_env.sh echo "Running tests for compass suite ${test_suite}..." bash .evergreen/pretest.sh # NOTE (@imlucas) Starting with MongoDB 4.0.4, the Server binaries # have dropped support for macOS 10.10 because it is now outside # of the supported version range. # https://docs.google.com/document/d/1IfQGC7wTtrlsc2SqURirvt_4uMuU606nXNbu-stw6bQ/edit # debug option is not very useful in normal runs, but helpful when # debugging any issues with tests. Set to "mocha*", "hadron*", or # "mongo*" for some helpful output from the test tooling we are using DEBUG=${debug} MONGODB_VERSION=${mongodb_version|4.0.3} npm run test-evergreen --unsafe-perm # - command: attach.results # params: # file_location: src/test-results.xml test-plugin: - <<: *restore-fetch-s3 - <<: *restore-unpack-s3 - <<: *generate-compass-env - command: shell.exec params: working_dir: src shell: bash script: | set -e source ~/compass_env.sh export ELECTRON_NO_ATTACH_CONSOLE=1 export ELECTRON_ENABLE_LOGGING=1 bash ./.evergreen/test-plugin.sh ${plugin|10gen/compass-connect} # - command: attach.xunit_results # params: # file: src/plugin/plugin-test-results.xml 'package': - command: shell.exec params: working_dir: src/packages/compass shell: bash script: | set -e # Load environment variables generated by `prepare` source ~/compass_env.sh echo "Synchronizing evergreen environment from Compass build tools..." npm run evergreen-expansions ${compass_distribution} - command: expansions.update params: file: src/packages/compass/expansions.yml - command: shell.exec params: working_dir: src/packages/compass shell: bash script: | set -e source ~/compass_env.sh cat < ~/compass_package.sh #! /usr/bin/env bash cd $(pwd) # Load environment variables source ~/compass_env.sh # For debugging any problems when the notary service fails. # @see https://github.com/mongodb-js/notary-service-client For details on what notary service is. export DEBUG=mongodb-notary* # Required to sign release assets export NOTARY_URL="http://notary-service.build.10gen.cc:5000" export NOTARY_AUTH_TOKEN="${signing_auth_token}" export NOTARY_SIGNING_KEY="${signing_key_name}" export NOTARY_SIGNING_COMMENT="Evergreen project mongodb/compass ${revision} - ${build_variant} - ${branch_name}" if [ `uname` == Darwin ]; then # We do print the environment during the build process in a few places # but we probably should stop doing that. After that, we can go back # to using plain APPLE_USERNAME and APPLE_PASSWORD environment variables. echo '{"appleUsername": "${apple_username}", "applePassword": "${apple_password}"}' > /tmp/compass-apple-cred.json export APPLE_CREDENTIALS_FILE="/tmp/compass-apple-cred.json" fi echo "Creating signed release build..." if [[ "$OSTYPE" == "cygwin" ]]; then echo "Starting Installer Service..." net start MSIServer fi export NPM_CONFIG_LOGLEVEL=info export DEBUG="*,-flora-colossus" npm run release-evergreen ${compass_distribution}; rm -f /tmp/compass-apple-cred.json EOF_BUILD_SH if [ `uname` == Darwin ]; then echo "Signing via ssh tunnel..." ssh -v -p 2222 localhost "bash ~/compass_package.sh" else if [[ "$OSTYPE" == "cygwin" ]]; then echo "Fetching signtool -> notary-service hack..." curl -fs \ -o "signtool.exe" \ --url "https://s3.amazonaws.com/boxes.10gen.com/build/signtool.exe" rm -f node_modules/electron-winstaller/vendor/signtool.exe rm -f node_modules/@mongodb-js/electron-wix-msi/vendor/signtool.exe chmod +x signtool.exe cp signtool.exe node_modules/@mongodb-js/electron-wix-msi/vendor/signtool.exe fi bash ~/compass_package.sh ls -la dist fi 'publish': command: shell.exec params: working_dir: src/packages/compass/ shell: bash script: | set -e # Load environment variables source ~/compass_env.sh # Required to upload release assets to GitHub export GITHUB_TOKEN=${leafybot_github_token} # Required to upload release assets to s3 for download center export DOWNLOAD_CENTER_AWS_ACCESS_KEY_ID=${aws_key_evergreen_integrations} export DOWNLOAD_CENTER_AWS_SECRET_ACCESS_KEY=${aws_secret_evergreen_integrations} echo "Uploading release assets to S3 and GitHub if needed..." npm run upload ${compass_distribution} 'save windows artifacts': # setup - <<: *save-artifact params: local_file: src/packages/compass/dist/${windows_setup_filename} remote_file: ${project}/${revision}/${windows_setup_filename} # MSI - <<: *save-artifact params: local_file: src/packages/compass/dist/${windows_msi_filename} remote_file: ${project}/${revision}/${windows_msi_filename} # ZIP - <<: *save-artifact params: local_file: src/packages/compass/dist/${windows_zip_filename} remote_file: ${project}/${revision}/${windows_zip_filename} content_type: application/zip # RELEASES file - <<: *save-artifact params: local_file: src/packages/compass/dist/RELEASES remote_file: ${project}/${revision}/${compass_distribution}-RELEASES # nupkg full - <<: *save-artifact params: local_file: src/packages/compass/dist/${windows_nupkg_full_filename} remote_file: ${project}/${revision}/${windows_nupkg_full_filename} 'save osx artifacts': # .dmg - <<: *save-artifact params: local_file: src/packages/compass/dist/${osx_dmg_filename} remote_file: ${project}/${revision}/${osx_dmg_filename} content_type: 'application/x-apple-diskimage' # .zip - <<: *save-artifact params: local_file: src/packages/compass/dist/${osx_zip_filename} remote_file: ${project}/${revision}/${osx_zip_filename} content_type: application/zip 'save linux artifacts': # .deb - <<: *save-artifact params: local_file: src/packages/compass/dist/${linux_deb_filename} remote_file: ${project}/${revision}/${linux_deb_filename} content_type: 'application/vnd.debian.binary-package' # .tar.gz - <<: *save-artifact params: local_file: src/packages/compass/dist/${linux_tar_filename} remote_file: ${project}/${revision}/${linux_tar_filename} content_type: application/x-gzip 'save rhel artifacts': # .rpm - <<: *save-artifact params: local_file: src/packages/compass/dist/${linux_rpm_filename} remote_file: ${project}/${revision}/${linux_rpm_filename} content_type: application/x-redhat-package-manager # .tar.gz - <<: *save-artifact params: local_file: src/packages/compass/dist/${linux_tar_filename} remote_file: ${project}/${revision}/${linux_tar_filename} content_type: application/x-gzip # Tasks tasks: - name: oneshot-compile-test-package-publish commands: - func: prepare - func: install - func: verify - func: test variants: [macos, windows, ubuntu, rhel] vars: debug: "mongo*" - func: package vars: compass_distribution: compass - func: publish vars: compass_distribution: compass - func: 'save windows artifacts' variants: [windows] - func: 'save osx artifacts' variants: [macos] - func: 'save linux artifacts' variants: [ubuntu] - func: 'save rhel artifacts' variants: [rhel] - func: package vars: compass_distribution: compass-isolated - func: publish vars: compass_distribution: compass-isolated - func: 'save windows artifacts' variants: [windows] - func: 'save osx artifacts' variants: [macos] - func: 'save linux artifacts' variants: [ubuntu] - func: 'save rhel artifacts' variants: [rhel] - func: package vars: compass_distribution: compass-readonly - func: publish vars: compass_distribution: compass-readonly - func: 'save windows artifacts' variants: [windows] - func: 'save osx artifacts' variants: [macos] - func: 'save linux artifacts' variants: [ubuntu] - func: 'save rhel artifacts' variants: [rhel] - name: compile depends_on: [] commands: - func: prepare - func: install - func: save - name: verify depends_on: [compile] tags: - 'verify' commands: - func: restore - func: verify - name: test-unit depends_on: [compile] tags: - test commands: - func: restore - func: test - name: test-functional depends_on: [compile] tags: - 'test' commands: - func: restore - func: test vars: test_suite: functional - name: test-data-service depends_on: [compile] commands: - func: test-plugin vars: { plugin: mongodb-js/data-service } - name: test-connect-plugin depends_on: [compile] commands: - func: test-plugin vars: { plugin: 10gen/compass-connect } - name: test-aggregation-builder-plugin depends_on: [compile] commands: - func: test-plugin vars: { plugin: mongodb-js/compass-aggregations } - name: package-and-publish-compass depends_on: [compile] commands: - func: restore - func: package vars: compass_distribution: compass - func: publish vars: compass_distribution: compass - func: 'save windows artifacts' variants: [windows] # NOTE (@imlucas) Because macos can't utilize task parallelism # and instead runs `oneshot-compile-test-package-publish` # save osx artifacts doesn't apply here until we have more than # 1 macos box setup to run functional tests. # - func: 'save osx artifacts' # variants: [macos] - func: 'save linux artifacts' variants: [ubuntu] - func: 'save rhel artifacts' variants: [rhel] - name: package-and-publish-compass-isolated depends_on: [compile] commands: - func: restore - func: package vars: compass_distribution: compass-isolated - func: publish vars: compass_distribution: compass-isolated - func: 'save windows artifacts' variants: [windows] - func: 'save linux artifacts' variants: [ubuntu] - func: 'save rhel artifacts' variants: [rhel] - name: package-and-publish-compass-readonly depends_on: [compile] commands: - func: restore - func: package vars: compass_distribution: compass-readonly - func: publish vars: compass_distribution: compass-readonly - func: 'save windows artifacts' variants: [windows] - func: 'save linux artifacts' variants: [ubuntu] - func: 'save rhel artifacts' variants: [rhel] # NOTE (@imlucas) Examples of how to extend which tests run # and against which MongoDB Server version. # # - name: test-renderer # depends_on: [compile] # tags: # - 'test' # commands: # - func: restore # - func: test # vars: # test_suite: renderer # - name: test-main # depends_on: [compile] # tags: # - 'test' # commands: # - func: restore # - func: test # vars: # test_suite: main # - name: test-enzyme # depends_on: [compile] # tags: # - 'test' # commands: # - func: restore # - func: test # vars: # test_suite: enzyme # - name: test-unit # depends_on: [compile] # tags: # - 'test' # commands: # - func: restore # - func: test # vars: # test_suite: unit # mongodb_version: stable # - name: test-functional-unstable-server # depends_on: [compile] # tags: # - 'test' # commands: # - func: restore # - func: test # vars: # test_suite: functional # mongodb_version: stable # - name: test-functional-unstable-server # depends_on: [compile] # tags: # - 'test' # commands: # - func: restore # - func: test # vars: # test_suite: functional # mongodb_version: unstable # - name: test-functional-36x-server # depends_on: [compile] # tags: # - 'test' # commands: # - func: restore # - func: test # vars: # test_suite: functional # mongodb_version: 3.6.x # - name: test-functional-34x-server # depends_on: [compile] # tags: # - 'test' # commands: # - func: restore # - func: test # vars: # test_suite: functional # mongodb_version: 3.4.x # - name: test-functional-26x-server # depends_on: [compile] # tags: # - 'test' # commands: # - func: restore # - func: test # vars: # test_suite: functional # mongodb_version: 2.6.x # TODO (@imlucas) determine OS/version deprecation policy, following server, so we don't fall behind # what maximal resources we're using. # See https://docs.google.com/document/d/1IfQGC7wTtrlsc2SqURirvt_4uMuU606nXNbu-stw6bQ/edit buildvariants: - name: macos display_name: MacOS run_on: macos-1014-codesign tasks: - name: oneshot-compile-test-package-publish - name: windows display_name: Windows run_on: windows-vsCurrent-large expansions: compass_distribution: compass tasks: - name: oneshot-compile-test-package-publish - name: ubuntu display_name: Ubuntu run_on: ubuntu1604-large tasks: - name: oneshot-compile-test-package-publish - name: rhel display_name: RHEL run_on: rhel76-large tasks: - name: oneshot-compile-test-package-publish