-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'psmf22-develop' into develop
- Loading branch information
Showing
18 changed files
with
456 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...n/java/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityCommands.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/******************************************************************************* | ||
* Copyright 2021, 2022 Open Text. | ||
* | ||
* The only warranties for products and services of Open Text | ||
* and its affiliates and licensors ("Open Text") are as may | ||
* be set forth in the express warranty statements accompanying | ||
* such products and services. Nothing herein should be construed | ||
* as constituting an additional warranty. Open Text shall not be | ||
* liable for technical or editorial errors or omissions contained | ||
* herein. The information contained herein is subject to change | ||
* without notice. | ||
*******************************************************************************/ | ||
package com.fortify.cli.tool.bugtracker_utility.cli.cmd; | ||
|
||
import com.fortify.cli.common.cli.cmd.AbstractContainerCommand; | ||
|
||
import picocli.CommandLine.Command; | ||
|
||
@Command( | ||
name = ToolBugTrackerUtilityCommands.TOOL_NAME, | ||
aliases = {"bugtrackerutility"}, | ||
subcommands = { | ||
ToolBugTrackerUtilityInstallCommand.class, | ||
ToolBugTrackerUtilityListCommand.class, | ||
ToolBugTrackerUtilityUninstallCommand.class | ||
} | ||
|
||
) | ||
public class ToolBugTrackerUtilityCommands extends AbstractContainerCommand { | ||
static final String TOOL_NAME = "bugtracker-utility"; | ||
} |
55 changes: 55 additions & 0 deletions
55
.../com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityInstallCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/******************************************************************************* | ||
* Copyright 2021, 2023 Open Text. | ||
* | ||
* The only warranties for products and services of Open Text | ||
* and its affiliates and licensors ("Open Text") are as may | ||
* be set forth in the express warranty statements accompanying | ||
* such products and services. Nothing herein should be construed | ||
* as constituting an additional warranty. Open Text shall not be | ||
* liable for technical or editorial errors or omissions contained | ||
* herein. The information contained herein is subject to change | ||
* without notice. | ||
*******************************************************************************/ | ||
package com.fortify.cli.tool.bugtracker_utility.cli.cmd; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
|
||
import com.fortify.cli.common.output.cli.mixin.OutputHelperMixins; | ||
import com.fortify.cli.tool._common.cli.cmd.AbstractToolInstallCommand; | ||
import com.fortify.cli.tool._common.helper.ToolHelper; | ||
import com.fortify.cli.tool._common.helper.ToolVersionInstallDescriptor; | ||
import com.fortify.cli.tool._common.util.FileUtils; | ||
|
||
import lombok.Getter; | ||
import picocli.CommandLine.Command; | ||
import picocli.CommandLine.Mixin; | ||
|
||
@Command(name = OutputHelperMixins.Install.CMD_NAME) | ||
public class ToolBugTrackerUtilityInstallCommand extends AbstractToolInstallCommand { | ||
@Getter @Mixin private OutputHelperMixins.Install outputHelper; | ||
@Getter private String toolName = ToolBugTrackerUtilityCommands.TOOL_NAME; | ||
|
||
@Override | ||
protected InstallType getInstallType() { | ||
return InstallType.EXTRACT_ZIP; | ||
} | ||
|
||
@Override | ||
protected void postInstall(ToolVersionInstallDescriptor descriptor) throws IOException { | ||
Path binPath = descriptor.getBinPath(); | ||
Files.createDirectories(binPath); | ||
FileUtils.copyResourceToDir(ToolHelper.getResourceFile(getToolName(), "extra-files/bin/FortifyBugTrackerUtility"), binPath); | ||
FileUtils.copyResourceToDir(ToolHelper.getResourceFile(getToolName(), "extra-files/bin/FortifyBugTrackerUtility.bat"), binPath); | ||
|
||
String version = descriptor.getOriginalDownloadDescriptor().getVersion(); | ||
String jarName = String.format("FortifyBugTrackerUtility-%s.jar", version); | ||
|
||
//we are renaming the jar to remove the version reference | ||
//this allows us to use pre-written bat/bash wrappers rather than having to dynamically generate those | ||
descriptor.getInstallPath().resolve(jarName).toFile().renameTo( | ||
descriptor.getInstallPath().resolve("FortifyBugTrackerUtility.jar").toFile()); | ||
|
||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...ava/com/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityListCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/******************************************************************************* | ||
* Copyright 2021, 2023 Open Text. | ||
* | ||
* The only warranties for products and services of Open Text | ||
* and its affiliates and licensors ("Open Text") are as may | ||
* be set forth in the express warranty statements accompanying | ||
* such products and services. Nothing herein should be construed | ||
* as constituting an additional warranty. Open Text shall not be | ||
* liable for technical or editorial errors or omissions contained | ||
* herein. The information contained herein is subject to change | ||
* without notice. | ||
*******************************************************************************/ | ||
package com.fortify.cli.tool.bugtracker_utility.cli.cmd; | ||
|
||
import com.fortify.cli.common.output.cli.mixin.OutputHelperMixins; | ||
import com.fortify.cli.tool._common.cli.cmd.AbstractToolListCommand; | ||
|
||
import lombok.Getter; | ||
import picocli.CommandLine.Command; | ||
import picocli.CommandLine.Mixin; | ||
|
||
@Command(name = OutputHelperMixins.List.CMD_NAME) | ||
public class ToolBugTrackerUtilityListCommand extends AbstractToolListCommand { | ||
@Getter @Mixin private OutputHelperMixins.List outputHelper; | ||
@Getter private String toolName = ToolBugTrackerUtilityCommands.TOOL_NAME; | ||
} |
26 changes: 26 additions & 0 deletions
26
...om/fortify/cli/tool/bugtracker_utility/cli/cmd/ToolBugTrackerUtilityUninstallCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/******************************************************************************* | ||
* Copyright 2021, 2023 Open Text. | ||
* | ||
* The only warranties for products and services of Open Text | ||
* and its affiliates and licensors ("Open Text") are as may | ||
* be set forth in the express warranty statements accompanying | ||
* such products and services. Nothing herein should be construed | ||
* as constituting an additional warranty. Open Text shall not be | ||
* liable for technical or editorial errors or omissions contained | ||
* herein. The information contained herein is subject to change | ||
* without notice. | ||
*******************************************************************************/ | ||
package com.fortify.cli.tool.bugtracker_utility.cli.cmd; | ||
|
||
import com.fortify.cli.common.output.cli.mixin.OutputHelperMixins; | ||
import com.fortify.cli.tool._common.cli.cmd.AbstractToolUninstallCommand; | ||
|
||
import lombok.Getter; | ||
import picocli.CommandLine.Command; | ||
import picocli.CommandLine.Mixin; | ||
|
||
@Command(name = OutputHelperMixins.Uninstall.CMD_NAME) | ||
public class ToolBugTrackerUtilityUninstallCommand extends AbstractToolUninstallCommand { | ||
@Getter @Mixin private OutputHelperMixins.Uninstall outputHelper; | ||
@Getter private String toolName = ToolBugTrackerUtilityCommands.TOOL_NAME; | ||
} |
6 changes: 6 additions & 0 deletions
6
...i-tool/src/main/resources/com/fortify/cli/tool/bugtracker-utility/bugtracker-utility.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#Versions must be listed in descending order to guarantee proper version selection when users provide a partial version number | ||
defaultDownloadUrl: https://github.com/fortify-ps/FortifyBugTrackerUtility/releases/download/{toolVersion}/FortifyBugTrackerUtility-{toolVersion}-dist.zip | ||
defaultVersion: 4.12 | ||
versions: | ||
- version: 4.12 | ||
digest: SHA-256:3c5142c63be6a6338f827e26ee79fdb70566dffd5a31680dce05544452c8a56a |
3 changes: 3 additions & 0 deletions
3
...esources/com/fortify/cli/tool/bugtracker-utility/extra-files/bin/FortifyBugTrackerUtility
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
java -jar ${SCRIPT_DIR}/../FortifyBugTrackerUtility.jar "$@" |
13 changes: 13 additions & 0 deletions
13
...rces/com/fortify/cli/tool/bugtracker-utility/extra-files/bin/FortifyBugTrackerUtility.bat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@rem *************************************************************************** | ||
@rem Copyright 2021, 2022 Open Text. | ||
@rem | ||
@rem The only warranties for products and services of Open Text | ||
@rem and its affiliates and licensors ("Open Text") are as may | ||
@rem be set forth in the express warranty statements accompanying | ||
@rem such products and services. Nothing herein should be construed | ||
@rem as constituting an additional warranty. Open Text shall not be | ||
@rem liable for technical or editorial errors or omissions contained | ||
@rem herein. The information contained herein is subject to change | ||
@rem without notice. | ||
@rem *************************************************************************** | ||
java -jar %~dp0\..\FortifyBugTrackerUtility.jar %* |
4 changes: 1 addition & 3 deletions
4
fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/fod-uploader/fod-uploader.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/sc-client/sc-client.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
fcli-core/fcli-tool/src/main/resources/com/fortify/cli/tool/vuln-exporter/vuln-exporter.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
...ctional-test/src/ftest/groovy/com/fortify/cli/ftest/tool/ToolBugTrackerUtilitySpec.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/** | ||
* Copyright 2023 Open Text. | ||
* | ||
* The only warranties for products and services of Open Text | ||
* and its affiliates and licensors ("Open Text") are as may | ||
* be set forth in the express warranty statements accompanying | ||
* such products and services. Nothing herein should be construed | ||
* as constituting an additional warranty. Open Text shall not be | ||
* liable for technical or editorial errors or omissions contained | ||
* herein. The information contained herein is subject to change | ||
* without notice. | ||
*/ | ||
package com.fortify.cli.ftest.tool | ||
|
||
import static com.fortify.cli.ftest._common.spec.FcliSessionType.SSC | ||
|
||
import com.fortify.cli.ftest._common.Fcli | ||
import com.fortify.cli.ftest._common.spec.FcliBaseSpec | ||
import com.fortify.cli.ftest._common.spec.FcliSession | ||
import com.fortify.cli.ftest._common.spec.Prefix | ||
import com.fortify.cli.ftest.ssc._common.SSCRoleSupplier | ||
import com.fortify.cli.ftest.ssc._common.SSCRoleSupplier.SSCRole | ||
import spock.lang.AutoCleanup | ||
import spock.lang.Requires | ||
import spock.lang.Shared | ||
import spock.lang.Stepwise | ||
|
||
@Prefix("tool.bugtracker-utility") @Stepwise | ||
class ToolBugTrackerUtilitySpec extends FcliBaseSpec { | ||
|
||
def "install"() { | ||
def args = "tool bugtracker-utility install -y latest" | ||
when: | ||
def result = Fcli.run(args) | ||
then: | ||
verifyAll(result.stdout) { | ||
size()>0 | ||
it[0].replace(' ', '').equals("NameVersionDefaultInstalledInstalldirBindirAction") | ||
it[1].replace(" ", "").contains("YesYes") | ||
it[1].contains("INSTALLED") | ||
} | ||
} | ||
|
||
def "listVersions"() { | ||
def args = "tool bugtracker-utility list" | ||
when: | ||
def result = Fcli.run(args) | ||
then: | ||
verifyAll(result.stdout) { | ||
size()>0 | ||
it[0].replace(' ', '').equals("NameVersionDefaultInstalledInstalldirBindir") | ||
it[1].replace(" ", "").startsWith("bugtracker-utility") | ||
it[1].replace(" ", "").contains("YesYes") | ||
} | ||
} | ||
|
||
def "uninstall"() { | ||
def args = "tool bugtracker-utility uninstall -y default" | ||
when: | ||
def result = Fcli.run(args) | ||
then: | ||
verifyAll(result.stdout) { | ||
size()>0 | ||
it[0].replace(' ', '').equals("NameVersionDefaultInstalledInstalldirBindirAction") | ||
it[1].replace(" ", "").contains("YesNoN/AN/AUNINSTALLED") | ||
} | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.