Skip to content

Commit

Permalink
Fix canary builds
Browse files Browse the repository at this point in the history
  • Loading branch information
asciidisco committed Aug 21, 2013
1 parent 3b518cf commit ccc2045
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ pids
logs
results

package-canary.json
index-canary.js
npm-debug.log
report.zip

Expand Down
21 changes: 21 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ module.exports = function(grunt) {
}
},

// generate contributors file
contributors: {
master: {
path: 'CONTRIBUTORS.md',
branch: 'master'
}
},

// compress artifacts
compress: {
main: {
Expand Down Expand Up @@ -236,17 +244,28 @@ module.exports = function(grunt) {

grunt.file.write('package.json', JSON.stringify(canaryPkg, true, 2));

// replace default includes with canary ones
var indexContents = grunt.file.read('index.js');
var oldContents = grunt.file.read('index.js');
indexContents = indexContents.replace('dalek-internal-driver', 'dalek-internal-driver-canary');
indexContents = indexContents.replace('dalek-internal-reporter', 'dalek-internal-reporter-canary');
indexContents = indexContents.replace('dalek-internal-timer', 'dalek-internal-timer-canary');
indexContents = indexContents.replace('dalek-internal-config', 'dalek-internal-config-canary');
grunt.file.write('index.js', indexContents);

var npm = require('npm');
npm.load({}, function() {
npm.registry.adduser(process.env.npmuser, process.env.npmpass, process.env.npmmail, function(err) {
if (err) {
grunt.log.error(err);
grunt.file.write('package.json', JSON.stringify(pkg, true, 2));
grunt.file.write('index.js', oldContents);
done(false);
} else {
npm.config.set('email', process.env.npmmail, 'user');
npm.commands.publish([], function(err) {
grunt.file.write('package.json', JSON.stringify(pkg, true, 2));
grunt.file.write('index.js', oldContents);
grunt.log.ok('Published canary build to registry');
done(!err);
});
Expand Down Expand Up @@ -302,12 +321,14 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-yuidoc');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-git-contributors');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-complexity');
grunt.loadNpmTasks('grunt-plato');
grunt.loadNpmTasks('grunt-bump');

// define runner tasks
grunt.registerTask('pre-commit', 'contributors')
grunt.registerTask('lint', 'jshint');
grunt.registerTask('test', ['clean:coverage', 'prepareCoverage', 'lint', 'mochaTest', 'generateCoverageBadge', 'complexity']);
grunt.registerTask('docs', ['clean:reportZip', 'clean:report', 'preparePlato', 'plato', 'yuidoc', 'compress']);
Expand Down
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dalekjs",
"version": "0.0.1",
"name": "dalekjs-canary-canary-canary-canary",
"version": "0.0.1-2013-08-21-15-44-56-2013-08-21-15-46-00-2013-08-21-15-46-47-2013-08-21-15-47-42",
"description": "A node based cross browser testing tool",
"main": "./index.js",
"directories": {
Expand Down Expand Up @@ -30,19 +30,22 @@
"grunt-include-replace": "~1.1.0",
"grunt-bump": "~0.0.11",
"blanket": "~1.1.5",
"chai": "~1.7.2"
"chai": "~1.7.2",
"grunt-git-contributors": "~0.1.4"
},
"scripts": {
"test": "grunt test"
},
"repository": {
"type": "git",
"url": "http://github.com/dalekjs/dalek.git"
"type": "git",
"url": "http://github.com/dalekjs/dalek.git"
},
"bugs": {
"url": "https://github.com/dalekjs/dalek/issues"
},
"keywords": ["dalekjs"],
"keywords": [
"dalekjs"
],
"author": {
"name": "Sebastian Golasch",
"email": "[email protected]",
Expand Down

0 comments on commit ccc2045

Please sign in to comment.