HiveBrain v1.2.0
Get Started
← Back to all entries
patternterraformMinor

Jenkins Pipeline job - remember previous values

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
previousjenkinsremembervaluesjobpipeline

Problem

I have a Jenkins Pipeline which uses Terraform and create a compute environment in GCP. There are like 5 questions in the build i.e.

1) GCP Project Name
2) Number of RHEL Servers
3) RHEL Server names
4) Number of CentOS Servers
5) CentOS Server names


This is a standard build job and users cannot build servers if not using this build.

The problem is that when a user comes back to request more servers, they have to fill up all the details again. They have to remember all the values they passed previously.

So the questions is: How do I make this user friendly without creating a separate build job for each GCP project and hard coding the values.

Solution

Depending on how long you keep builds for, the Rebuild option in the left hand sidebar will allow you rebuild a previous run of the job with the parameters intact.

Simply find a previous build of the job that that particular user kicked off last time, click into it, then choose Rebuild from the sidebar.

Again this will only work if Jenkins keeps enough builds. We save two weeks for a particular job and I have a coworker who saves a link directly to x build of the job, then once he rebuilds updates his link to the new one, etc. This way he can just open the link he has saved, click Rebuild, and he's good to go as long as he's inside that two week window.

I believe you can even choose to Keep this build forever for a couple of your "template" builds, making them more easily accessible.

Context

StackExchange DevOps Q#4550, answer score: 2

Revisions (0)

No revisions yet.