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

Document Jenkinsfile integration for mongodb-plugin

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • mongodb-plugin
    • None
    • jenkins 2.32 mongodb-plugin 1.3

      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

          [JENKINS-41136] Document Jenkinsfile integration for mongodb-plugin

          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

          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

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

              Created:
              Updated: