We have several jobs that run our application on different DB schema.
Now each job uses its own DB schema.
It's now very convenient.
If the same job is started several times then these builds will be executed one by one, not in parallel, because they use the same DB scheme.
Is it possible to manage list of DB schema in Jenkins?
If some scheme is not used now by any jobs, then new job could start to use this free scheme.
Is there some plugin that allow to do it?
Asked
Active
Viewed 2,730 times
3

Volodymyr Bezuglyy
- 16,295
- 33
- 103
- 133
-
What is the duration of the your jobs? – plsgogame Mar 29 '13 at 11:27
-
Different. 5-10 minutes, 1 hour, .. – Volodymyr Bezuglyy Mar 29 '13 at 11:35
-
This is an interesting question. Did you ever find a solution for it? – mmalmeida May 04 '16 at 19:22
2 Answers
0
I think , if they were running 10-15 minutes, then it would be set up assembly only one job. But on this situation you can use script which would deal management of your databases.
- Check available DB(may use db.txt file with names db)
- Get name free DB and put this name to config file your application or config job.
- Mark on db.txt file this DB "not available".
- After finish job set this DB available.
If you run second job paralleling you script check list db , and put second db, because first DB was with mark "not available".
If I not understand your Q, please forgive me.

plsgogame
- 1,334
- 15
- 28
-
I cannot create only one job. There should be ability to run jobs separately. And I know that it is possible to create our own DB management tool/script. But there are a lot of plugins for Jenkins. Maybe there is one that can solve our problem :) – Volodymyr Bezuglyy Mar 29 '13 at 12:01
-
You do not need to create only one job, you can use this script for many jobs. And this script will not complex. – plsgogame Mar 29 '13 at 12:05
-
It will be complex. How to check that DB is not used? Job can be stopped manually or could be failed by some reason. And in this case job will not notify, that DB is free. – Volodymyr Bezuglyy Mar 29 '13 at 12:53
-
**How to check that DB is not used?** -> You will check txt-file which is all written. **Job can be stopped manually or could be failed by some reason. And in this case job will not notify, that DB is free.** -> it's more complex, ok. Good luck with plugins. :) – plsgogame Mar 29 '13 at 12:57
0
Try using the Jenkins Exclusion Plugin. You will have to define each DB as a separate Resource and set each job to monitor the correct resource(s).
We use it for a very similar situation between multiple jobs.

jwernerny
- 6,978
- 2
- 31
- 32
-
I do not understand how to use it. Job could use db1 or db2 or db3 or ... But if job started to use db1 then other jobs should be able to use db2 and db3. How to configure plugin for such situation? – Volodymyr Bezuglyy Mar 29 '13 at 15:27
-
I think I misunderstood your original question. It seems like what you really want is a to be able to have Jenkins assign a DB to a job at run time from a pool of DBs. Is that correct? If yes, then this won't help. – jwernerny Mar 29 '13 at 18:46
-
Not only DB. Assign some resource at the start of job and put this resource back to pool if job is finished or stopped by user. – Volodymyr Bezuglyy Mar 29 '13 at 22:06