jenkinsci / docker-swarm-plugin

Jenkins plugin which allows to add a Docker Swarm as a cloud agent provider
https://plugins.jenkins.io/docker-swarm/
MIT License
55 stars 47 forks source link

docker volume driver support with manual source and destination input in agent specs #76

Open rga-madhu opened 4 years ago

rga-madhu commented 4 years ago

The current docker swarm plugin is generating the source volume name by default based on the location of the job. for ex: ("Source": "Madhu_Test_build_test-build_test") for the job "/job/Madhu-Test/job/build_test/"on jenkins server.

The scenario I'm working on requires this to be manually assigned similar to "Volumes" section under container specs in docker plugin.

Right now docker service inspect shows below block for mount section on the agent launched by this plugin when a build is triggered with Cache driver name = netapp and Cache Dirs = self_assigned_docker_volume:/home/jenkins

"Mounts": [ { "Type": "volume", "Source": "Madhu_Test_build_test-build_test", "Target": "self_assigned_docker_volume:/home/jenkins", "VolumeOptions": { "DriverConfig": { "Name": "netapp" } } } ]

I'm looking for an option that should be like below:

"Mounts": [ { "Type": "volume", "Source": "self_assigned_docker_volume", "Target": "/home/jenkins", "VolumeOptions": { "DriverConfig": { "Name": "netapp" } } } ]

rga-madhu commented 4 years ago

Any update on this ?