sghill / grunt-jenkins Goto Github PK
View Code? Open in Web Editor NEWManage Jenkins with Grunt.
Home Page: documentup.com/sghill/grunt-jenkins
License: MIT License
Manage Jenkins with Grunt.
Home Page: documentup.com/sghill/grunt-jenkins
License: MIT License
Given I have not created the pipeline directory
When I attempt to verify/install jobs/plugins
Then I should see a friendly error message saying I need to create the pipeline directory or backup first
If you happen to run a verify task before backing up, which doesn't make a lot of sense anyway, it presents a somewhat confusing message:
Running "jenkins-verify-jobs" task
Found 1 jobs.
>> Error: ENOENT, readdir 'pipeline'
Good afternoon,
I'm trying to use your plugin to get a backup of the Jenkins jobs in my installation. However, I'm facing an issue because my Jenkins is installed in http://localhost:8080/jenkins/ (and not on http://localhost:8080).
What happens is that it retrieves all the jobs correctly, but when trying to retrieve each job individually it constructs the URLs like this:
http://localhost:8080/jenkins//jenkins/job/Test-A-Config/config.xml
instead of
http://localhost:8080/jenkins/job/Test-A-Config/config.xml
I've seen how to fix it:
In jenkinsServer.js, line 50 I've replaced this
var path = j.url.replace(/^https?\:\/{2}[^\/]+\/(.*)/, '$1');
var url = [serverUrl, path].join('/');
with:
var path = j.url.replace(/^https?\:\/{2}[^\/]+\/(.*)/, '$1');
var serverHost = serverUrl.replace(/^(https?\:\/{2}[^\/]+)\/(.*)/, '$1');
var url = [serverHost, path].join('/');
Would it be possible for you to add this fix (or a similar one of your liking) to your published code? Because I have it running locally with the fix I mentioned above, but I'm planning to use it from the Jenkins server itself in which I don't have access to modify the jenkinsServer.js.
Thank you!
Best regards,
Emilio
Loading "fileSystem.js" tasks and helpers...ERROR
>> Error: Cannot find module 'grunt'
Loading "jenkins.js" tasks and helpers...ERROR
>> Error: Cannot find module 'grunt'
Loading "jenkinsServer.js" tasks and helpers...ERROR
>> Error: Cannot find module 'grunt'
appears if grunt is not installed locally to the project.
Howdy,
I've run through the instructions in the README and I'm unable to get either changes to existing jobs or new jobs to install properly.
I have an almost completely vanilla setup:
Jenkins (ver. 1.537) running on localhost
node v0.10.21
grunt-cli v0.1.9
grunt v0.4.1
The job is embarrassingly simple:
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<logRotator class="hudson.tasks.LogRotator">
<daysToKeep>-1</daysToKeep>
<numToKeep>7</numToKeep>
<artifactDaysToKeep>-1</artifactDaysToKeep>
<artifactNumToKeep>-1</artifactNumToKeep>
</logRotator>
<keepDependencies>false</keepDependencies>
<properties/>
<scm class="hudson.scm.NullSCM"/>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers/>
<concurrentBuild>false</concurrentBuild>
<builders>
<hudson.tasks.Shell>
<command>echo 'Howdy'</command>
</hudson.tasks.Shell>
</builders>
<publishers/>
<buildWrappers/>
</project>
Hand editing the command and numToKeep values, the verify command shows a difference (as expected), but running install does not update jenkins.
Any suggestions to help debug what's going wrong here?
Good afternoon,
I'm experiencing the following issue when trying to install grunt-jenkins:
install grunt-jenkins --save-dev
[ ...] - extract:hawk: verb gentlyRm don't care about contents; nuking D:\jenkinsbackupjobs\node_modules\.staging\hawk-aa7b66d5\node_modules
After this nothing happens (I waited more than 30 minutes) and the CPU usage is very high during this time.
I encounter similar issues with different nodejs/npm versions (like nodejs7/npm 3.10.8, nodejs6/npm 3.10.4 nodejs4/npm 2.14.4)
Do you know what can be the cause of this? Thank you very much in advance.
package.json:
{
"name": "jenkinsbackupjobs",
"version": "1.0.0",
"description": "Jenkins Backup Jobs",
"main": "Gruntfile.js",
"devDependencies": {
}
}
Gruntfile.js:
module.exports = function(grunt) {
grunt.initConfig({
// ...
jenkins: {
serverAddress: 'https://MyJenkinsURL/',
pipelineDirectory: 'jenkins-pipeline' // optional, default: 'pipeline'
}
});
grunt.loadNpmTasks('grunt-jenkins');
// ...
};
jenkins.js
requires jenkins.serverAddress
to be set, that's why grunt.loadNpmTasks("grunt-jenkins")
should be placed after grunt.initConfig({jenkins:{serverAddress:"host"}});
Given my jenkins requires authentication
When I attempt to install/verify/backup a job without authentication
Then I should see a friendly error message saying I need to be authenticated
Currently --
Running "jenkins-verify-jobs" task
Fatal error: Unexpected token <
I'm posting this issue to let you know that we will be publishing Grunt 0.4 on Monday, February 18th.
If your plugin is not already Grunt 0.4 compatible, would you please consider updating it? For an overview of what's changed, please see our migration guide.
If you'd like to develop against the final version of Grunt before Monday, please specify "grunt": "0.4.0rc8"
as a devDependency in your project. After Monday's release, you'll be able to use "grunt": "~0.4.0"
to actually publish your plugin. If you depend on any plugins from the grunt-contrib series, please see our list of release candidates for compatible versions. All of these will be updated to final status when Grunt 0.4 is published.
Also, in an effort to reduce duplication of effort and fragmentation in the developer community, could you review the grunt-contrib series of plugins to see if any of your functionality overlaps significantly with them? Grunt-contrib is community maintained with 40+ contributors—we'd love to discuss any additions you'd like to make.
Finally, we're working on a new task format that doesn't depend on Grunt: it's called node-task. Once this is complete, there will be one more conversion, and then we'll never ask you to upgrade your plugins to support our changes again. Until that happens, thanks for bearing with us!
If you have any questions about how to proceed, please respond here, or join us in #grunt on irc.freenode.net.
Thanks, we really appreciate your work!
I'm running into an issue running any of the grunt-jenkins tasks, for some reason it seems to have an undefined grunt.log and cannot call grunt.log.writeln().
grunt jenkins-list
Running "jenkins-list-jobs" task
/Users/ddaniels/Dropbox/code/github/projects/product/node_modules/grunt-jenkins/tasks/jenkinsServer.js:14
grunt.log.writeln(['Found', jobs.length, 'jobs.'].join(' '));
^
TypeError: Cannot call method 'writeln' of undefined
at Request.fetchJobs (/Users/ddaniels/Dropbox/code/github/projects/product/node_modules/grunt-jenkins/tasks/jenkinsServer.js:14:17)
at Request.init.self.callback (/Users/ddaniels/Dropbox/code/github/projects/product/node_modules/grunt-jenkins/node_modules/request/main.js:122:22)
at Request.EventEmitter.emit (events.js:99:17)
at Request.<anonymous> (/Users/ddaniels/Dropbox/code/github/projects/product/node_modules/grunt-jenkins/node_modules/request/main.js:655:16)
at Request.EventEmitter.emit (events.js:126:20)
at IncomingMessage.Request.start.self.req.self.httpModule.request.buffer (/Users/ddaniels/Dropbox/code/github/projects/product/node_modules/grunt-jenkins/node_modules/request/main.js:617:14)
at IncomingMessage.EventEmitter.emit (events.js:126:20)
at IncomingMessage._emitEnd (http.js:366:10)
at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)
at Socket.socketOnData [as ondata] (http.js:1367:20)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.