1.0.1 • Published 8 years ago
ember-cli-deploy-git-ci v1.0.1
ember-cli-deploy-git-ci
This is an ember-cli-deploy plugin for managing deployments to a git branch in a CI environment like Travis.
It takes care of configuring a git user and a deploy key to use when pushing your branch, but expects the actual publish to be managed by a plugin like ember-cli-deploy-git
NEVER COMMIT YOUR DEPLOY KEY IN PLAINTEXT TO SOURCE CONTROL. If you do, you should immediately revoke the key and generate a new one.
Installation
ember install ember-cli-deploy ember-cli-deploy-build ember-cli-deploy-git ember-cli-deploy-git-ci
Configuration
In config/deploy.js, (which ember-cli-deploy will helpfully generate for you), you can pass the following options within a git-ci key:
enabled: whether this plugin should activate at all (defaults to true if theCIenvironment variable is set,falseotherwise in order not to interfere with local deploys)userName: a user name to be reflected in the deploy commit (defaults to the activeuser.nameconfig for the local repo if present, orTomsterotherwise)userEmail: a user email to be reflected in the deploy commit (defaults to the activeuser.emailconfig for the local repo if present, ortomster@emberjs.comotherwise)deployKey: the text of the SSH private key to use for deploying (defaults to theDEPLOY_KEYenvironment variable; overridesdeployKeyPathif both are set)deployKeyPath: the path on disk to your deploy key
An example:
ENV['git-ci'] = {
  userName: 'DeployBot',
  userEmail: 'deploys@example.com',
  deployKey: process.env.SECRET_KEY
};Setting Up a Deploy Key
- Use 
ssh-keygento generate a new public/private key pair:ssh-keygen -t rsa -b 4096 -N '' -f deploy_key - This will produce two files in your current directory: 
deploy_key(the private key) anddeploy_key.pub(the public key). Do not commit these files to your repository. - Configure the public key with your git hosting provider. For Github, you can find this under the settings for your repository, at 
https://github.com/<user>/<repo>/settings/keys - Configure the private key with your CI provider. For Travis, the simplest way to accomplish this is by using the Travis CLI to set the 
DEPLOY_KEYenvironment variable for your repo:travis env set -- DEPLOY_KEY "$(cat deploy_key)"