ENVIRONMENT
I have a series of jobs in Jenkins where Job #1 is an initial build and job #n is deployment to production.
Only the first few jobs are connected, and all jobs are parameterized.
I only build the one time, and if that build is successful post build steps trigger a job to deploy that build to dev.
After deployment to dev I have to manually go to Jenkins and click to run the job to deploy to the next region/environment.
THE PROBLEM
I am able to successfully pass the $GIT_COMMIT
to the downstream jobs because as a workspace based environment variable during job-run I can write it to a file for use later.
However, $CHANGES
is an email-ext
specific variable and I am having issues writing its contents to a file I can pass to downstream jobs for the purpose of tracking what the current build is deploying in a given environment.
My unfamiliarity with Groovy
and my weak Google-fu
have made trying pre-send script
and post-send script
difficult to work with to get the data I want passed to downstream jobs.
WHAT I HAVE TRIED
What works
- I am able to send HTML emails using
email-ext
- I am able to pass
$GIT_COMMIT
to a file and use it in downstream jobs - I am able to load the contents of a file into an email using
email-ext
What doesn't work
I cannot seem to use Groovy in a
pre-send script
to output the$CHANGES
to a file for use.Trying to output
$CHANGES
to a file in apost-send script
also does not work, but probably wouldn't be best anyway since it would likely come after any opportunity to pass the file to a downstream job.
WHAT I HAVE NOT TRIED
I have seen suggestions to use the changelog registered by the SCM process, which apparently is recorded in XML which must then be parsed by either the initial build job or downstream jobs if it is to be formatted for inclusion in an HTML
email.
HELP
If anyone has any suggestion on what to try next I would appreciate it. I'm pulling my hair out.