Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-41136

Document Jenkinsfile integration for mongodb-plugin

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: mongodb-plugin
    • Labels:
      None
    • Environment:
      jenkins 2.32 mongodb-plugin 1.3
    • Similar Issues:

      Description

      I have mongodb-plugin installed on my jenkins server, and it works fine with a freestyle job that I create manually. But how do I utilize the mongodb inside a Jenkinsfile pipeline? Is this documented anywhere? the wiki page only portrays the GUI:

      https://wiki.jenkins-ci.org/display/JENKINS/MongoDB+Plugin

        Attachments

          Activity

          Hide
          thoth Josh Cox added a comment - - edited

          For now at least I'm just installing mongodb and running directly with something like:

          sh "mongod --quiet --fork --noauth --pidfilepath ${WORKSPACE}/mongopid --logpath ${WORKSPACE}/data/log --dbpath ${WORKSPACE}/data/db"
          

          and killing it later with:

          sh "kill -HUP `cat ${WORKSPACE}/mongopid`"
          

          inside my Jenkinsfile pipeline, hardly seems to be a best practice though. I think eventually I'll be moving mongodb to a docker pipeline

          Show
          thoth Josh Cox added a comment - - edited For now at least I'm just installing mongodb and running directly with something like: sh "mongod --quiet --fork --noauth --pidfilepath ${WORKSPACE}/mongopid --logpath ${WORKSPACE}/data/log --dbpath ${WORKSPACE}/data/db" and killing it later with: sh "kill -HUP `cat ${WORKSPACE}/mongopid`" inside my Jenkinsfile pipeline, hardly seems to be a best practice though. I think eventually I'll be moving mongodb to a docker pipeline

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            thoth Josh Cox
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: