From 0576b7bcd04327acb3d082a71f7aaf5fef484488 Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Wed, 26 Jun 2019 15:41:02 -0400 Subject: Override value of HOME to be the job's workspace root dir. (#56) * Set HOME to be workspace root before setting other env vars. * Expand self-testing Jenkinsfile to include HOME override checking. --- vars/utils.groovy | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'vars') diff --git a/vars/utils.groovy b/vars/utils.groovy index 57c9ef6..b7e2d3e 100644 --- a/vars/utils.groovy +++ b/vars/utils.groovy @@ -622,6 +622,10 @@ def expandEnvVars(config) { // Expand environment variable specifications by using the shell // to dereference any var references and then render the entire // value as a canonical path. + + // Override the HOME dir to be the job workspace. + config.env_vars.add("HOME=${env.WORKSPACE}") + for (var in config.env_vars) { // Process each var in an environment defined by all the prior vars. withEnv(config.runtime) { -- cgit