Click here to view the video of this presentation.
We all know we should do it. But where to start? What should we test? Do i need a CI pipeline to test? How to convince the manager to spend time on testing?
These are all valid questions, and i hope to answer them all for you. I've been adding tests to my code for a few years now, and i'm at the point where adding tests speed up my development instead of slowing it down. But the road to this point can be bumpy. I hope to give you a head start and improve your code.
Writing cronjobs can be hard. The environment where it is executed is different. You have to make sure you cronjob doesn’t get executed multiple times. The output is hard to control. How handle errors? I’m going to show you a better way using software you already used: Jenkins.
Cronjobs are a great feature of applications of any size. They allow all kinds of stuff: imports, exports, background processing, etc. But managing cronjobs can be hard. Some common problems developers encounter when trying to manage cronjobs:
The environment is different. Paths and executables may be different and not available.
It is possible that cronjobs overlap and bring your server to it’s knees.
What about output? How to handle that?
Jenkins is most known for it’s Continuous Integration capabilities. But did you know you can also use it to execute other tasks? It’s a great fit to manage your cronjobs. Only need an e-mail when an task fails? It’s just configuration! You want to check the queue size on your clients server? Build a mysql query and execute it.
It gives you a great flexibility over managing your cronjobs.