I have a Jenkins CI/CD platform in fargate. The agents (slaves) are configured to kick new jobs and builds. Jobs trigger new agents, agents run the pipelines and that's kind of it.
However, now, I would like to backup my builds, config and states to an s3 bucket. I've looked at plenty of plugins but none of them had the requirements I want. So I decided to just use shell commands that will tar the files and upload the content to the bucket I want.
The problem I am having is when I use the agent to run commands inside the master to upload the jenkins_home directory, the agent is running inside it's own container and uploads the agent home directory.
I've looked at the slave to master access document, but it didn't really worked or I got too confused with the article. So the only way to run the backup pipeline is when I run the pipeline with master, which I dont really want to do it. I have agents for that, they should run these jobs.
Is there any way how to configure Jenkins slaves to run commands inside the master node? Commands like uploading to s3 the jenkins home directory?
Thank you!