- Use Archiving Artifacts / Copy Artifacts to copy files between jobs in the same pipeline (maybe) (SO)
- Could also use copy workspace, but not sure how that would treat multiple parallel builds.
- Maybe http://antagonisticpleiotropy.blogspot.co.uk/2012/02/implementing-real-build-pipeline-with.html
Pass a value from a script to Jenkins build steps (SO)
Can't just set environment variables in script steps because they are lost when the script step ends.
Instead, write them to a properties file, and then inject that into the subsequent step:
mkdir -p target
echo "CONTENT_VERSION=$(src/jenkins/content_version.sh)" > target/jenkins-env.properties
Then specify target/jenkins-env.properties
in a Parameters from properties file
parameters option.
From ref and ref, in the Git configuration for a job, add Additional Behaviours -> Check out to specific local branch
with a value of **
or empty. This will mean that Git will attempt to give the checked-out branches the same branch name as in the remote repository (instead of having just a commit id).