-
Improvement
-
Resolution: Unresolved
-
Minor
-
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:
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