Use Private Meteor Packages on Codeship
Remarks#
Note that we did not discuss how to use & develop your local packages. There are several ways, I suggest to use the PACKAGE_DIRS
environment variable described by David Weldon on his website.
Install MGP
We make use of Dispatches great Meteor Github Packages (mgp) package:
npm install --save mgp
Then, add the following command to your package.json
scripts:
"mgp": "mgp"
Create a file named git-packages.json
in your project root. Add a config for every (private) Meteor Github package that your project depends on:
{
"my:yet-another-private-package": {
"git": "git@github.com:my/private-packages.git",
"branch": "dev"
}
}
More information about how to configure your private packages can be found on the projects Github repo.
Configure Codeship to Install Private Github Packages
Append the following command to the Codeship setup commands:
meteor npm run mgp
Now, we need to give Codeship access to these private repositories. There is a Codeship documentation article describing this process in detail but here are the steps that you have to take for Github:
- Create a new Github account. A so called Machine user.
- Remove the deploy key from your repo under test. Here: https://github.com/YOUR_USERNAME/REPO_UNDER_TEST/settings/keys
- Grab the SSH public key from your codeship projects settings. Somewhere here: https://codeship.com/projects/PROJECT_NUMBER/configure
- Add this SSH public key to your machine user’s SSH keys: https://github.com/settings/keys
- Give this machine user access to all your referenced repositories
It should be similar for BitBucket and others.