[Galaxy]CircleCI downloads meteor tool for every deployment

I’m deploying to Galaxy with CircleCI, this is my YAML file:

## Customize the test machine
machine:

  timezone:
    Asia/Manila # Set the timezone

dependencies:
  pre:
    - cd src && npm install # install all node dependencies

  cache_directories:
    - "src/node_modules" 
    - "~/.npm"
    - "~/.meteor"

  override:
    - if [ -d ~/.meteor ]; then sudo ln -s ~/.meteor/meteor /usr/local/bin/meteor; fi
    - if [ ! -e $HOME/.meteor/meteor ]; then curl https://install.meteor.com | sh; fi

test:
  override:
    - cd src && npm run lint # use ESLINT for testing

deployment:
  staging:
    branch: staging
    commands:
      - sh ./deploy.sh --staging

What surprises me is that meteor-tool always downloads when we deploy, which of course skyrockets the run time of a CI build to 15 minutes. Is there a way to set it up so that the meteor-tool does not need to be downloaded all the time?

1 Like

We had exactly the same problem and my solution was adding the following line into the override section of the config file:

- touch ~/.meteor/packages/meteor-tool/1\.4\.3_1

This seems to trick Meteor into thinking that the Meteor tool 1.4.3.1 is already installed.

Of course the downside is that we need to update the file name every time a new version is released.

Would you mind sharing a YAML file? I haven’t gotten it to work with your suggestions, maybe there’s something else still wrong with it.

Sure, here it is:

machine:
  node:
    version: 4.2.1
  environment:
    PATH: ${PATH}:/home/ubuntu/.meteor
dependencies:
  cache_directories:
    - "~/.meteor"
    - "~/project/node_modules"
  override:
    - if [ ! -f ~/.meteor/meteor ]; then curl https://install.meteor.com/?release=1.3.5.1 | /bin/sh; fi
    - touch ~/.meteor/packages/meteor-tool/1\.4\.3_1
    - npm install
    # if any project packages were updated, this will download and install them
    - meteor list
test:
  override:
    - npm run test-ci-unit
    - npm run test-ci-integration
    - npm run test-ci-packages
    - git checkout develop
    - git reset --hard origin/develop
    - git checkout $CIRCLE_BRANCH
    - npm run lint-diff
1 Like