Skip to content

Commit

Permalink
fix(pipeline): We no longer copy the Detect jar to a path that we kno…
Browse files Browse the repository at this point in the history
…w Docker will mount. Instead, we trust that the user will mount Detect.
  • Loading branch information
rottebds committed May 10, 2019
1 parent d4638a4 commit e2bdc64
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
@@ -1,3 +1,25 @@
/**
* blackduck-detect
*
* Copyright (c) 2019 Synopsys, Inc.
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package com.synopsys.integration.jenkins.detect;

import java.io.File;
Expand Down
Expand Up @@ -23,7 +23,6 @@
package com.synopsys.integration.jenkins.detect.substeps;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
Expand Down Expand Up @@ -97,14 +96,9 @@ private DetectSetupResponse setUpForJarExecution(final String pathToDetectJar, f
javaExecutableManager.logJavaVersion();

final Path detectJar = Paths.get(pathToDetectJar);
final Path workspaceDetectJar = Paths.get(workspaceTempPath).resolve(detectJar.getFileName());

if (Files.notExists(workspaceDetectJar)) {
Files.move(detectJar, workspaceDetectJar);
}

logger.info("Running Detect: " + workspaceDetectJar.getFileName());
return new DetectSetupResponse(DetectSetupResponse.ExecutionStrategy.JAR, workspaceDetectJar.toString(), javaExecutablePath);
logger.info("Running Detect: " + detectJar.getFileName());
return new DetectSetupResponse(DetectSetupResponse.ExecutionStrategy.JAR, javaExecutablePath, pathToDetectJar);
}

private DetectSetupResponse setUpForScriptExecution(final DetectSetupResponse.ExecutionStrategy executionStrategy) throws IOException, IntegrationException {
Expand Down

0 comments on commit e2bdc64

Please sign in to comment.