0

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!

1 Answer 1

0

In your question, you already gave two good solutions to this problem:

  1. I've looked at the slave to master access document, but it didn't really worked or I got too confused with the article.

  2. 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.

If you want to access the master's $JENKINS_HOME, these are both good solutions. Neither of the reasons you gave for not choosing these solutions are solid technical arguments, just personal reasons ("I got too confused/I don't want to"). Personally, I've used the second solution just fine when I've needed my jobs to access master $JENKINS_HOME. If you go for the second solution, please be aware of the security implications.

However, it sounds like you just need to backup your Jenkins instance. In that case, there's no reason you need to use Jenkins specifically to back up Jenkins. You can use any backup solution you want. Using a backups solution external to Jenkins would mean you won't need to worry about access control within Jenkins.

1
  • Jenkins is running in fargate, there isn't a backup solution with fargate, even if fargate will have a backup solution it still wont help me out with my plan. The reason I am backing up and restoring Jenkins it is because the master will rebuild itself everyday, or week, and when the master restores it self I would like to restore the jobs states too. I have the configs and pipeline already baked into the master. Thanks for advise thou. Commented Apr 13, 2019 at 12:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .