Skip to content

Commit

Permalink
COMPASS-545: Evergreen integration for Linux (#708)
Browse files Browse the repository at this point in the history
* Make evergreen do less.

* Save linux artifacts

* Windows and linux fixes from hadron-build

* hadron-build config renamed to info

* catch yaml for expansions

* Evergreen can build linux installers

* Upstream Windows fix

* Can't take the cheap way out of windows icon problem...

* Taking rhel62 for a spin

* More rhel tuning

* Bump for windows debugging

* rhel experiment failed

Windows is green now so getting to stable place so we can merge this
branch and pick up rpm as sep ticket.

* latest hadron-build

* Testing linux symlink
  • Loading branch information
imlucas committed Dec 22, 2016
1 parent a75e856 commit b8cf19d
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 74 deletions.
124 changes: 52 additions & 72 deletions .evergreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ exec_timeout_secs: 1800

variables:
# function "save release variants" is conditional on the following
# -> all except ubuntu
- &save_release_variants
- osx-1010
- windows-64
- ubuntu


#######################################
Expand Down Expand Up @@ -76,18 +76,12 @@ functions:
export CI=1
export EVERGREEN=1
export PATH="${node_path}:$PATH"
ls -alh ${node_path}
test -n '${add_env_appdata|}' && export APPDATA='${add_env_appdata|}'
${npm|npm} version --json
# less chatty installs: "--depth 0" reduces detail of "npm ls" tree output
export NPM_CONFIG_DEPTH=0
export NPM_CONFIG_LOGLEVEL=error
${npm|npm} install node-gyp
${npm|npm} install
# INT-1081 Attach parseable log of installed packages.
# Don't allow it to fail build.
${npm|npm} ls --depth=Infinity --json=true > npm_install.json || true
# TODO (imlucas) Move this to `hadron-build`. Way too much bash
# in this process no one else knows exists already.
# For Windows: retrieve a fake "signtool.exe" which proxies to notary-service,
# and remove the real one from our path. Must run after "npm install"
"fetch signtool" : &fetch_signtool
Expand Down Expand Up @@ -128,13 +122,22 @@ functions:
export SIGNTOOL_PARAMS="yes"
test -n '${add_env_appdata|}' && export APPDATA='${add_env_appdata|}'
export DEBUG=hadron*,electron*
# Run static analysis on code and project configuration
${npm|npm} run check
# Create a release build
${npm|npm} run release;
ls -alh dist/
# Upload release assets to S3 and GitHub
export GITHUB_TOKEN=${leafybot_github_token}
export DOWNLOAD_CENTER_AWS_ACCESS_KEY_ID=${aws_key_evergreen_integrations}
export DOWNLOAD_CENTER_AWS_SECRET_ACCESS_KEY=${aws_secret_evergreen_integrations}
${npm|npm} run upload;
pkill mongod || true
# end of embedded script
EOF_BUILD_SH
Expand All @@ -159,18 +162,6 @@ functions:
ssh -p 2222 localhost "echo SSH_LOCALHOST_TEST_OK"
fi
"save npm_install.json":
command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: "src/npm_install.json"
remote_file: "${project}/${build_variant}/${revision}/npm_install.json"
bucket: mciuploads
permissions: public-read
content_type: application/json
display_name: "npm_install.json"

"save windows artifacts":
# setup
- command: s3.put
Expand Down Expand Up @@ -247,63 +238,57 @@ functions:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: "src/dist/${osx_dmg_filename}"
remote_file: "${project}/${build_variant}/${revision}/${name}-${version}-${platform}-${arch}.dmg"
remote_file: "${project}/${build_variant}/${revision}/${osx_dmg_filename}"
bucket: mciuploads
permissions: public-read
content_type: "application/x-apple-diskimage"
display_name: "${name}-${version}-${platform}-${arch}.dmg"
display_name: "${osx_dmg_filename}"
# .zip
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: "src/dist/${osx_zip_filename}"
remote_file: "${project}/${build_variant}/${revision}/${name}-${version}-${platform}-${arch}.zip"
remote_file: "${project}/${build_variant}/${revision}/${osx_zip_filename}"
bucket: mciuploads
permissions: public-read
content_type: application/zip
display_name: "${name}-${version}-${platform}-${arch}.zip"

"save LICENSE":
command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: "src/dist/LICENSE"
remote_file: "${project}/${build_variant}/${revision}/LICENSE"
bucket: mciuploads
permissions: public-read
content_type: text/plain
display_name: LICENSE

"save version":
command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: "src/dist/version"
remote_file: "${project}/${build_variant}/${revision}/version"
bucket: mciuploads
permissions: public-read
content_type: text/plain
display_name: version

"upload release":
command: shell.exec
params:
working_dir: src
script: |
set -ev
export DEBUG=*;
export PATH="${node_path}:$PATH"
export CI=1
export EVERGREEN=1
export GITHUB_TOKEN=${leafybot_github_token}
export DOWNLOAD_CENTER_AWS_ACCESS_KEY_ID=${aws_key_evergreen_integrations}
export DOWNLOAD_CENTER_AWS_SECRET_ACCESS_KEY=${aws_secret_evergreen_integrations}
test -n '${add_env_appdata|}' && export APPDATA='${add_env_appdata|}'
${npm|npm} run upload;
display_name: "${osx_zip_filename}"

"save linux artifacts":
# .deb
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: "src/dist/${linux_deb_filename}"
remote_file: "${project}/${build_variant}/${revision}/${linux_deb_filename}"
bucket: mciuploads
permissions: public-read
content_type: "application/vnd.debian.binary-package"
display_name: "${linux_deb_filename}"
# # .rpm
# - command: s3.put
# params:
# aws_key: ${aws_key}
# aws_secret: ${aws_secret}
# local_file: "src/dist/${linux_rpm_filename}"
# remote_file: "${project}/${build_variant}/${revision}/${linux_rpm_filename}"
# bucket: mciuploads
# permissions: public-read
# content_type: application/x-redhat-package-manager
# display_name: "${linux_rpm_filename}"
# .tar.gz
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: "src/dist/${linux_tar_filename}"
remote_file: "${project}/${build_variant}/${revision}/${linux_tar_filename}"
bucket: mciuploads
permissions: public-read
content_type: application/x-gzip
display_name: "${linux_tar_filename}"

#######################################
# Tasks #
Expand Down Expand Up @@ -347,20 +332,15 @@ tasks:
variants:
- windows-64
- func: "build"
- func: "save npm_install.json"
- func: "save windows artifacts"
variants:
- windows-64
- func: "save osx artifacts"
variants:
- osx-1010
- func: "save LICENSE"
- func: "save linux artifacts"
variants:
- windows-64
- func: "save version"
variants:
- windows-64
- func: "upload release"
- ubuntu

# Define shortcut for use below
variables:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"test-unit": "npm test -- --unit",
"test-release": "npm test -- --release",
"upload": "hadron-build upload",
"evergreen-expansions": "hadron-build config --format=yaml --output=expansions.yml --flatten"
"evergreen-expansions": "hadron-build info --format=yaml --flatten > expansions.yml"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -178,7 +178,7 @@
"electron-prebuilt": "1.2.8",
"enzyme": "^2.5.1",
"eslint-config-mongodb-js": "^2.2.0",
"hadron-build": "^3.0.3",
"hadron-build": "^4.1.1",
"jsdom": "^9.8.3",
"mocha": "^3.1.2",
"mongodb-js-precommit": "^0.2.9",
Expand Down

0 comments on commit b8cf19d

Please sign in to comment.