The pipeline approach in 0.5.x requires some modifications to ember-cli-deploy plugins and a few to deploy configuration scripts.
- Add the following dependencies:
ember-cli-deploy-build
andember-cli-deploy-revision-data
- Change your config/deploy.js to return a function instead of an object, for each
environment
setting:ENV["%INDEX_ADAPTER_NAME%"] = { /* plugin config goes here */ }
ENV["%ASSETS_ADAPTER_NAME%"] = { /* plugin config goes here */ }
Depending on what type of adapters you're publishing, you'll have to make different amendments.
- update package.json keywords to include the keyword "ember-cli-deploy-plugin"
npm install ember-cli-deploy-plugin --save
and subclass the new https://github.com/lukemelia/ember-cli-deploy-plugin for all your adapters.- implement
createDeployPlugin
in index.js and return an extendedember-cli-deploy-plugin
from there. - listen to hooks to actually upload stuff, most notably upload (index and assets adapter) and activate (index adapter)
- instruct your users to update their config (see above)
- instruct your users to install ember-cli-deploy-build (see above)
- replace console.log statements to this.log to play nicely with the formatting in ember-cli-deploy
- instruct your users to install ember-cli-deploy-revision-data (see above)
- mind you that the revision key is now under context.revisionData.revisionKey (provided ember-cli-deploy-revision-data is installed) and it doesn't include your project name yet.
_key: function(context) {
var revisionKey = context.commandOptions.revision || context.revisionData.revisionKey.substr(0, 8);
return context.project.name() + ':' + revisionKey;
}
- mind you that you won't be passed the contents of index.html to your upload function, instead you will have to read the file using the filesystem package,
var path = require('path');
var fs = require('fs');
var readFile = denodeify(fs.readFile);
upload: function() {
readFile(path.join(context.distDir, "index.html"))
.then(function(buffer) {
return buffer.toString();
}).then(function(indexContents) {
// do uploady stuff with contents here
});
}
- if you have a hard reference to "tmp/asset-sync", replace that with context.distDir.