Meteor

2 minute read

Versions and setup

Meteor is not installed on CloudBees CodeShip Basic by default, but it can be easily added.

First run Meteor’s default installer:

\curl https://install.meteor.com/ | sh

Custom Versions

This setup script will always pull for the most recent meteor tool. You can also call meteor commands with a specified release:

meteor create test --release 0.6.1

Dependencies

You can use npm or yarn to install your dependencies.

NPM

We set the $PATH to include the node_modules/.bin folder so all executables installed through npm can be run.

We also automatically cache the $REPO_ROOT/node_modules directory between builds to optimize build performance. You can read this article to learn more.

Yarn

You can also use Yarn to install your dependencies as an alternative to npm. Yarn is pre-installed on the build VMs. We configure yarn to write into $HOME/cache/yarn, which is also cached.

meteor npm install -g yarn meteor yarn

Parallelization

In addition to parallelizing your tests explicitly via parallel pipelines, some customers have found using the mocha-parallel-tests npm is a great way to speed up your tests.

Note that we do not officially support or integrate with this module and that it is possible for this to cause resource and build failure issues, as well.

Notes and Known Issues

Deployment

Basic Deployment

meteor deploy METEOR_APP_URL

Deployment with Session Info

Add the following environment variables to your project configuration:

  • METEOR_SESSION

  • METEOR_USER_ID

  • METEOR_TOKEN

  • METEOR_APP_URL

And include the following command to your deployment pipeline:

\curl -sSL https://raw.githubusercontent.com/codeship/scripts/master/deployments/meteor.sh | bash -s

Process Out of Memory

Sometimes Meteor commands will run into Node’s default memory limit resulting in this error:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
Aborted (core dumped)

If this happens in your build you can increase the memory limit by setting this environment variable for the project:

  • TOOL_NODE_FLAGS=–max-old-space-size=4096