code: public @Nonnull EnvVars buildEnvironment(@Nonnull TaskListener listener) throws IOException, InterruptedException {
          EnvVars env = new EnvVars();
  
          Node node = getNode();
          if (node==null)     return env; // bail out
  
          for (NodeProperty nodeProperty: Jenkins.getInstance().getGlobalNodeProperties()) {
              nodeProperty.buildEnvVars(env,listener);
          }
  
          for (NodeProperty nodeProperty: node.getNodeProperties()) {
              nodeProperty.buildEnvVars(env,listener);
          }
  
          // TODO: hmm, they don't really belong
          String rootUrl = Jenkins.getInstance().getRootUrl();
          if(rootUrl!=null) {
              env.put("HUDSON_URL", rootUrl); // Legacy.
              env.put("JENKINS_URL", rootUrl);
          }
  
          return env;
      }
docs: Creates an environment variable override to be used for launching processes on this node.
  
  @see ProcStarter#envs(Map)
  @since 1.489