Using Jenkins – Build Enviroment
I have a Jenkins server that is responsible for building and deploying all of my microservices. However, each of these microservices needs a different version of a library for build and deployment. What is the best approach to separate this kind of build environment within Jenkins? Is it to use slaves? Is there a solution that involves Docker?
2 Solutions collect form web for “Using Jenkins – Build Enviroment”
Not sure the libraries are python, ruby or others. Use
python as sample.
requirements.txt for each applications, in requirements.txt, you can define the version for each library or packages.
MyApp Framework==0.9.4 Library>=0.2
In Jenkins, install plugin named
shiningpanda, define the job in
virtualenv builder with its own build environment.
pip install -r requirements.txt # run your application here.
You should be fine to find similar plugin for your applications, if they are ruby, java, or others.
each microservice should be its own build job. Jenkins keeps the workspace of each job separate, so they shouldn’t overwrite each other. ideally, each microservice is in its own source code repository or subfolder. in Jenkins’ job definition, you can point to each specific microservice repo. HTH.