diff options
author | Quentin Schulz <quentin.schulz@theobroma-systems.com> | 2022-10-28 16:31:57 +0200 |
---|---|---|
committer | Quentin Schulz <quentin.schulz@theobroma-systems.com> | 2022-10-28 16:31:57 +0200 |
commit | c88ed5bce21c3c25c3c90f695563e5e48662d495 (patch) | |
tree | 4c27614d23898138b48ab190f70670a5740009dc /Jenkinsfile | |
parent | 693426f02b2c988507ccd5d69778e8976ca87430 (diff) |
Jenkinsfile: reuse sstate-cache and source tarballs between builds
The build time can be drastically shortened by re-using the sstate-cache
and source tarballs between builds, so let's do that.
Note: this requires that all Jenkins agents this job can run on to have
two environment variables set: YOCTO_SSTATE_DIR and YOCTO_DL_DIR, both
being a path to out-of-workspace directories that persist between
builds.
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Diffstat (limited to 'Jenkinsfile')
-rw-r--r-- | Jenkinsfile | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Jenkinsfile b/Jenkinsfile index 890e77c..b88bb6a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,6 +5,12 @@ * * Use the Jenkins configuration * + * Note: The Jenkins agent running this job should have the following environment variables set: + * - YOCTO_SSTATE_DIR + * - YOCTO_DL_DIR + * These variables should point to a directory outside of the current WORKSPACE, + * so that it can be re-used between jobs. + * * Parametrized Build -> Choice-Parameter -> YOCTO_MACHINE * Pipeline -> * Do not allow concurrent builds: <checked> @@ -52,6 +58,10 @@ pipeline { -e USER_ID=${JENKINS_USER_ID} \ -e GROUP_ID=${JENKINS_GROUP_ID} \ -e KAS_MACHINE \ + -e SSTATE_DIR=${YOCTO_SSTATE_DIR} \ + -v ${YOCTO_SSTATE_DIR}:${YOCTO_SSTATE_DIR} \ + -e DL_DIR=${YOCTO_DL_DIR} \ + -v ${YOCTO_DL_DIR}:${YOCTO_DL_DIR} \ --tmpfs /tmp \ ' label 'docker' |