Coder Social home page Coder Social logo

grunt-jenkins's Issues

Issue when Jenkins installed in a non-root URL

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

Cannot find module `grunt` when grunt installed globally

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.

Error installing grunt-jenkins

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');
  // ...
};

TypeError: Cannot call method 'writeln' of undefined on grunt.log.writeln

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)

Friendly error message when Jenkins requires auth

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 <

jenkins-install-jobs doesn't appear to be working

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 &apos;Howdy&apos;</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?

Grunt 0.4 Release

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!

Friendly error message when there is no pipeline directory present

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'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.