• ■ ■ ■ ■ ■ ■
    pom.xml
    skipped 9 lines
    10 10   <version>1.0.5</version>
    11 11   </parent>
    12 12   <artifactId>agent</artifactId>
    13  - <version>1.1.4</version>
     13 + <version>1.1.5</version>
    14 14   <build>
    15 15   <plugins>
    16 16   <plugin>
    17 17   <groupId>io.onedev</groupId>
    18 18   <artifactId>plugin-maven</artifactId>
    19  - <version>2.0.6</version>
     19 + <version>2.0.7</version>
    20 20   <executions>
    21 21   <execution>
    22 22   <?m2e execute onConfiguration,onIncremental?>
    skipped 122 lines
    145 145   </dependency>
    146 146   </dependencies>
    147 147   <properties>
    148  - <k8shelper.version>2.3.1</k8shelper.version>
     148 + <k8shelper.version>2.3.2</k8shelper.version>
    149 149   <jackson.version>2.12.1</jackson.version>
    150 150   <jersey.version>2.26</jersey.version>
    151 151   <bootstrap>true</bootstrap>
    skipped 4 lines
  • ■ ■ ■ ■ ■ ■
    src/main/java/io/onedev/agent/ShellExecutorUtils.java
    skipped 139 lines
    140 140  
    141 141   File userDir = new File(buildDir, "user");
    142 142   FileUtils.createDir(userDir);
    143  - Map<String, String> environments = new HashMap<>();
    144  - environments.put("HOME", userDir.getAbsolutePath());
    145 143  
    146 144   String messageData = jobData.getJobToken() + ":" + workspaceDir.getAbsolutePath();
    147 145   new Message(MessageType.REPORT_JOB_WORKSPACE, messageData).sendBy(session);
    skipped 35 lines
    183 181   for (Map.Entry<CacheInstance, String> entry: cacheAllocations.entrySet()) {
    184 182   if (!PathUtils.isCurrent(entry.getValue())) {
    185 183   File sourceDir = entry.getKey().getDirectory(cacheHomeDir);
    186  - File destDir = resolveCachePath(workspaceDir, userDir, entry.getValue());
     184 + File destDir = resolveCachePath(workspaceDir, entry.getValue());
    187 185   if (destDir.exists())
    188 186   FileUtils.deleteDir(destDir);
    189 187   else
    skipped 7 lines
    197 195   }
    198 196  
    199 197   Commandline shell = getShell();
     198 + Map<String, String> environments = new HashMap<>();
     199 + environments.put("GIT_HOME", userDir.getAbsolutePath());
    200 200   shell.workingDir(workspaceDir).environments(environments);
    201 201   shell.addArgs(jobScriptFile.getAbsolutePath());
    202 202  
    skipped 8 lines
    211 211   jobLogger.log("Checking out code...");
    212 212   Commandline git = new Commandline(Agent.gitPath);
    213 213   git.workingDir(workspaceDir);
     214 + Map<String, String> environments = new HashMap<>();
     215 + environments.put("HOME", userDir.getAbsolutePath());
    214 216   git.environments(environments);
    215 217   
    216 218   CloneInfo cloneInfo = checkoutExecutable.getCloneInfo();
    skipped 107 lines
    324 326   return new Commandline("sh");
    325 327   }
    326 328  
    327  - public static File resolveCachePath(File workspaceDir, File homeDir, String cachePath) {
     329 + public static File resolveCachePath(File workspaceDir, String cachePath) {
    328 330   if (cachePath.startsWith(KubernetesHelper.HOME_PREFIX)) {
     331 + File homeDir = new File(System.getProperty("user.home"));
    329 332   return new File(homeDir, cachePath.substring(KubernetesHelper.HOME_PREFIX.length()));
    330 333   } else {
    331 334   File cacheDir = new File(cachePath);
    skipped 64 lines
Please wait...
Page is in error, reload to recover