Open uhafner opened 2 months ago
Thanks a lot for this proposal, Ulli. I'll have a look at your repo.
The jobs supplied with the current controller image are defined in the jobs
subdirectory of the dockerfiles
directory.
Adding other jobs to the controller image is technically feasible and relatively straightforward.
The main challenge lies in tailoring the job list for each profile:
We have two main approaches to consider:
API-based Job Management:
Post-Start Job Addition:
Both solutions have their merits and drawbacks, warranting further discussion and evaluation.
Wouldn't it be simpler if we would create for each profile that contains specific jobs another Docker compose service, that simply copies the specific job into a volume? And then the controller can copy these files into the job folder? Like the sidekick image is using the ssh folder? Or is this not possible in Docker?
I have a PoC that works with the maven
profile for the time being, but it's still failing with the python
profile.
It's promising, though, and it uses the existing docker services.
The current setup creates a running configuration of Jenkins with a specific agent, e.g. a maven agent. It would be also helpful, if the provided hello-world job would be profile dependent. I.e., when selecting the maven profile it should configure and build a maven project, and so on.
In my Jenkins student setup I am using such jobs for maven, see https://github.com/uhafner/codingstyle/tree/main/docker/images/jenkins-controller/preconfigured-jobs for more details.
Since I did not find an easy way to add profile specific jobs here, I created this issue rather than a PR. Once the general idea is possible, I can copy one of my projects of my codingstyle into this tutorial repository.