Skip to content
Snippets Groups Projects
Commit 23725b8d authored by Sandro Weber's avatar Sandro Weber Committed by BBP code review
Browse files

Merge "fixing bower register"

parents 671fe909 e79e4203
No related branches found
No related tags found
No related merge requests found
...@@ -141,45 +141,6 @@ module.exports = function(grunt) { ...@@ -141,45 +141,6 @@ module.exports = function(grunt) {
grunt.registerTask('build_and_watch', ['watch']); grunt.registerTask('build_and_watch', ['watch']);
grunt.registerTask('doc', ['clean', 'jsdoc']); grunt.registerTask('doc', ['clean', 'jsdoc']);
grunt.registerTask('bower_register', function(){
var request = require('request');
var bowerConfig = grunt.file.readJSON('./bower.json');
var baseUrl = grunt.file.readJSON('./.bowerrc').registry;
var done = this.async();
var registerComponent = function(done) {
grunt.log.writeln('Send registration request');
if (! (bowerConfig && bowerConfig.repository && bowerConfig.repository.url)) {
grunt.fail.warn('Missing repository.url key in bower.json');
done(false);
}
request.post(baseUrl+'/packages/', {
form: {
name: bowerConfig.name,
url: bowerConfig.repository.url
}
}, function(error, response){
if (response.statusCode !== 201) {
grunt.fail.warn('Registration failed:' + response.statusCode + ' - ' + error);
done(false);
} else {
grunt.log.writeln('registration successful');
done();
}
});
};
request.get(baseUrl+'/packages/'+bowerConfig.name, function(error, response) {
if (error || response.statusCode !== 200) {
registerComponent(done);
} else {
grunt.log.writeln('already registered');
done();
}
});
});
grunt.registerTask('ci', 'Run all the build steps on the CI server', function(target) { grunt.registerTask('ci', 'Run all the build steps on the CI server', function(target) {
var tasks = ['concat', 'jshint', 'uglify']; var tasks = ['concat', 'jshint', 'uglify'];
var branch = this.options().gerritBranch; var branch = this.options().gerritBranch;
...@@ -190,8 +151,6 @@ module.exports = function(grunt) { ...@@ -190,8 +151,6 @@ module.exports = function(grunt) {
tasks.push('gitcommit:bump'); tasks.push('gitcommit:bump');
tasks.push('gitpush:bump'); tasks.push('gitpush:bump');
tasks.push('gittag:dist'); tasks.push('gittag:dist');
tasks.push('bower_register');
} }
grunt.task.run(tasks); grunt.task.run(tasks);
}); });
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
"version": "0.1.1", "version": "0.1.1",
"private": true, "private": true,
"repository": { "repository": {
"url": "ssh://bbpcode.epfl.ch/neurorobotics/gzweb/gz3d" "url": "git+ssh://bbpcode.epfl.ch/neurorobotics/gzweb/gz3d",
"type": "git"
}, },
"main": "build/gz3d.js", "main": "build/gz3d.js",
"dependencies": { "dependencies": {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment