Skip to content

Commit

Permalink
Move s3 publishing config from ember-publisher to ember data
Browse files Browse the repository at this point in the history
  • Loading branch information
rondale-sc committed Jul 28, 2014
1 parent b6e5fa2 commit ebe3bc0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
3 changes: 2 additions & 1 deletion bin/publish_to_s3.js
Expand Up @@ -15,5 +15,6 @@
// ./bin/publish_to_s3.js
// ```
var S3Publisher = require('ember-publisher');
publisher = new S3Publisher({project: 'ember-data'});
var configPath = require('path').join(__dirname, '../config/s3ProjectConfig.js')
publisher = new S3Publisher({projectConfigPath: configPath});
publisher.publish();
31 changes: 31 additions & 0 deletions config/s3ProjectConfig.js
@@ -0,0 +1,31 @@
module.exports = function(revision, tag, date){
return {
'ember-data.js': fileObject('ember-data', '.js', 'text/javascript', revision, tag, date),
'ember-data.min.js': fileObject('ember-data.min', '.js', 'text/javascript', revision, tag, date),
'ember-data.prod.js': fileObject('ember-data.prod', '.js', 'text/javascript', revision, tag, date)
}
}

function fileObject(baseName, extension, contentType, currentRevision, tag, date) {
var fullName = "/" + baseName + extension;
return {
contentType: contentType,
destinations: {
canary: [
'canary' + fullName,
'canary/daily/' + date + fullName,
'canary/shas/' + currentRevision + fullName
],
stable: [
'stable' + fullName,
'stable/daily/' + date + fullName,
'stable/shas/' + currentRevision + fullName
],
beta: [
'beta' + fullName,
'beta/daily/' + date + fullName,
'beta/shas/' + currentRevision + fullName
]
}
}
}
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -13,7 +13,7 @@
"aws-sdk": "~2.0.0-rc8",
"bower": "~1.3",
"defeatureify": "~0.1.4",
"ember-publisher": "0.0.3",
"ember-publisher": "0.0.6",
"grunt": "~0.4.2",
"grunt-cli": "~0.1.13",
"grunt-contrib-clean": "~0.5.0",
Expand Down

0 comments on commit ebe3bc0

Please sign in to comment.