Skip to content

Commit 3bb9938

Browse files
SIGINT-2425: bridge binary renamed
1 parent 662a5f8 commit 3bb9938

File tree

5 files changed

+29
-28
lines changed

5 files changed

+29
-28
lines changed

blackduck-security-task/dist/index.js

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

blackduck-security-task/dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

blackduck-security-task/src/blackduck-security-task/bridge.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ export class Bridge {
6464
constructor() {
6565
this.bridgeExecutablePath = "";
6666
this.bridgeArtifactoryURL =
67-
"https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/bridge-cli";
67+
"https://artifactory.internal.synopsys.com/artifactory/clops-local/clops.sig.synopsys.com/bridge/binaries/bridge-cli-bundle";
6868
this.bridgeUrlPattern = this.bridgeArtifactoryURL.concat(
69-
"/$version/bridge-cli-$version-$platform.zip"
69+
"/$version/bridge-cli-bundle-$version-$platform.zip"
7070
);
7171
this.bridgeUrlLatestPattern = this.bridgeArtifactoryURL.concat(
72-
"/latest/bridge-cli-$platform.zip"
72+
"/latest/bridge-cli-bundle-$platform.zip"
7373
);
7474
}
7575

@@ -360,11 +360,12 @@ export class Bridge {
360360
);
361361
}
362362
// To check whether bridge already exists with same version mentioned in bridge url
363-
const versionsArray = bridgeUrl.match(".*bridge-cli-([0-9.]*).*");
363+
const versionsArray = bridgeUrl.match(".*bridge-cli-bundle-([0-9.]*).*");
364364
if (versionsArray) {
365365
version = versionsArray[1];
366366
if (!version) {
367-
const regex = /\w*(bridge-cli-(win64|linux64|macosx|macos_arm).zip)/;
367+
const regex =
368+
/\w*(bridge-cli-bundle-(win64|linux64|macosx|macos_arm).zip)/;
368369
version = await this.getBridgeVersionFromLatestURL(
369370
bridgeUrl.replace(regex, "versions.txt")
370371
);

blackduck-security-task/test/unit/blackduck-security-task/bridge-cli-platform.spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe("Platform", () => {
2424
value: "linux"
2525
})
2626
bridgeDefaultPath = path.join(process.env["HOME"] as string, constants.BRIDGE_CLI_DEFAULT_PATH_LINUX);
27-
bridgeUrl = "https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/bridge-cli/0.1.244/bridge-cli-0.1.244-linux64.zip"
27+
bridgeUrl = "https://artifactory.internal.synopsys.com/artifactory/clops-local/clops.sig.synopsys.com/bridge/binaries/bridge-cli-bundle/0.1.244/bridge-cli-bundle-0.1.244-linux64.zip"
2828
})
2929

3030
after(() => {
@@ -73,7 +73,7 @@ describe("Platform", () => {
7373
const cpuInfo = sandbox.stub(os, "cpus");
7474
cpuInfo.returns(fakeCpus);
7575
bridgeDefaultPath = path.join(process.env["HOME"] as string, constants.BRIDGE_CLI_DEFAULT_PATH_MAC);
76-
bridgeUrl = "https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/bridge-cli/0.1.244/bridge-cli-0.1.244-macosx.zip"
76+
bridgeUrl = "https://artifactory.internal.synopsys.com/artifactory/clops-local/clops.sig.synopsys.com/bridge/binaries/bridge-cli-bundle/0.1.244/bridge-cli-bundle-0.1.244-macosx.zip"
7777
})
7878

7979
after(() => {
@@ -109,7 +109,7 @@ describe("Platform", () => {
109109

110110
bridgeDefaultPath = path.join(
111111
process.env["USERPROFILE"] as string, constants.BRIDGE_CLI_DEFAULT_PATH_WINDOWS)
112-
bridgeUrl = "https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/bridge-cli/0.1.244/bridge-cli-0.1.244-win64.zip"
112+
bridgeUrl = "https://artifactory.internal.synopsys.com/artifactory/clops-local/clops.sig.synopsys.com/bridge/binaries/bridge-cli-bundle/0.1.244/bridge-cli-bundle-0.1.244-win64.zip"
113113
})
114114

115115
after(() => {

blackduck-security-task/test/unit/blackduck-security-task/bridge.spec.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -263,18 +263,18 @@ describe("Download Bridge", () => {
263263
let bridgeDefaultPath = "";
264264
if (osName === "linux") {
265265
bridgeDefaultPath = path.join(process.env["HOME"] as string, constants.BRIDGE_CLI_DEFAULT_PATH_LINUX);
266-
bridgeUrl = "https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/bridge-cli/0.1.244/bridge-cli-0.1.244-linux64.zip"
266+
bridgeUrl = "https://artifactory.internal.synopsys.com/artifactory/clops-local/clops.sig.synopsys.com/bridge/binaries/bridge-cli-bundle/2.9.2/bridge-cli-bundle-2.9.2-linux64.zip"
267267
} else if (osName === "win32") {
268268
bridgeDefaultPath = path.join(
269269
process.env["USERPROFILE"] as string, constants.BRIDGE_CLI_DEFAULT_PATH_WINDOWS)
270-
bridgeUrl = "https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/bridge-cli/0.1.244/bridge-cli-0.1.244-win64.zip"
270+
bridgeUrl = "https://artifactory.internal.synopsys.com/artifactory/clops-local/clops.sig.synopsys.com/bridge/binaries/bridge-cli-bundle/2.9.2/bridge-cli-bundle-2.9.2--win64.zip"
271271
} else if (osName === "darwin") {
272272
bridgeDefaultPath = path.join(
273273
process.env["HOME"] as string, constants.BRIDGE_CLI_DEFAULT_PATH_MAC)
274274
if (isIntel) {
275-
bridgeUrl = "https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/bridge-cli/0.1.244/bridge-cli-0.1.244-macosx.zip"
275+
bridgeUrl = "https://artifactory.internal.synopsys.com/artifactory/clops-local/clops.sig.synopsys.com/bridge/binaries/bridge-cli-bundle/2.9.2/bridge-cli-bundle-2.9.2-macosx.zip"
276276
} else {
277-
bridgeUrl = "https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/bridge-cli/0.1.244/bridge-cli-0.1.244-macos_arm.zip"
277+
bridgeUrl = "https://artifactory.internal.synopsys.com/artifactory/clops-local/clops.sig.synopsys.com/bridge/binaries/bridge-cli-bundle/2.9.2/bridge-cli-bundle-2.9.2-macos_arm.zip"
278278
}
279279
}
280280

@@ -587,8 +587,8 @@ describe("Download Bridge", () => {
587587
});
588588

589589
it("returns the URL for the latest version when neither BRIDGECLI_DOWNLOAD_URL nor BRIDGECLI_DOWNLOAD_VERSION are defined", async () => {
590-
const bridgeUrl = "https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/bridge-cli/latest/bridge-cli"
591-
sandbox.stub(bridge, "getBridgeVersionFromLatestURL").returns(Promise.resolve("0.1.244"));
590+
const bridgeUrl = "https://artifactory.internal.synopsys.com/artifactory/clops-local/clops.sig.synopsys.com/bridge/binaries/bridge-cli-bundle"
591+
sandbox.stub(bridge, "getBridgeVersionFromLatestURL").returns(Promise.resolve("2.9.2"));
592592
sandbox.stub(bridge, "getVersionUrl").returns(bridgeUrl);
593593
sandbox.stub(bridge, "checkIfBridgeVersionExists").returns(Promise.resolve(false));
594594
const result = await bridge.getBridgeUrl();
@@ -598,15 +598,15 @@ describe("Download Bridge", () => {
598598
it("returns the URL for the latest version when getBridgeVersionFromLatestURL is empty", async () => {
599599

600600
sandbox.stub(bridge, "getBridgeVersionFromLatestURL").returns(Promise.resolve("/latest"));
601-
sandbox.stub(bridge, "getVersionUrl").returns("bridge-cli/latest/bridge-cli");
601+
sandbox.stub(bridge, "getVersionUrl").returns("bridge-cli-bundle/latest/bridge-cli-bundle");
602602
const result = await bridge.getBridgeUrl();
603603
expect(result).contains("/latest");
604604
});
605605

606606
it("returns the URL for the latest version when getBridgeVersionFromLatestURL is empty: failure", async () => {
607607
sandbox.stub(bridge, "getLatestVersionUrl").returns("");
608608
sandbox.stub(bridge, "getBridgeVersionFromLatestURL").returns(Promise.resolve(""));
609-
sandbox.stub(bridge, "getVersionUrl").returns("bridge-cli/0.0.0/bridge-cli-macosx.zip");
609+
sandbox.stub(bridge, "getVersionUrl").returns("bridge-cli-bundle/0.0.0/bridge-cli-bundle-macosx.zip");
610610
sandbox.stub(bridge, "checkIfBridgeVersionExists").returns(Promise.resolve(false));
611611
const result = await bridge.getBridgeUrl().catch(errorObj => {
612612
expect(errorObj.message).contains("Invalid artifactory latest url");
@@ -683,7 +683,7 @@ describe("Download Bridge", () => {
683683

684684
it("BRIDGECLI_DOWNLOAD_URL is defined and invalid for current os", async () => {
685685
Object.defineProperty(inputs, "BRIDGECLI_DOWNLOAD_URL", {
686-
value: "https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/bridge-cli/0.2.57/bridge-cli-0.2.57-win64.zip",
686+
value: "https://artifactory.internal.synopsys.com/artifactory/clops-local/clops.sig.synopsys.com/bridge/binaries/bridge-cli-bundle/2.9.2/bridge-cli-bundle-2.9.2-win64.zip",
687687
});
688688
sandbox.stub(bridge, "checkIfBridgeVersionExists").returns(Promise.resolve(false));
689689
sandbox.stub(bridge, "getBridgeUrl").returns(Promise.resolve(bridgeUrl))
@@ -875,13 +875,13 @@ describe("Download Bridge", () => {
875875

876876
sandbox.stub(bridge, "getBridgeVersionFromLatestURL").returns(Promise.resolve('0.2.1'));
877877

878-
const result = await bridge.getBridgeVersionFromLatestURL("https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/bridge-cli/latest/bridge-cli-macosx.zip");
878+
const result = await bridge.getBridgeVersionFromLatestURL("https://artifactory.internal.synopsys.com/artifactory/clops-local/clops.sig.synopsys.com/bridge/binaries/bridge-cli-bundle-macosx.zip");
879879
assert.equal(result, '0.2.1');
880880
});
881881

882882
it("Bridle cli latest version test: windows", async () => {
883883
const result = await bridge.getLatestVersionUrl();
884-
expect(result).contains('/latest/bridge-cli');
884+
expect(result).contains('/latest/bridge-cli-bundle');
885885
});
886886

887887
it('Test getBridgeVersionFromLatestURL -status 200', async () => {
@@ -898,7 +898,7 @@ describe("Download Bridge", () => {
898898
sinon.stub(httpc, 'HttpClient').returns({
899899
get: httpClientStub,
900900
} as any);
901-
const result = await bridge.getBridgeVersionFromLatestURL("https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/bridge-cli/latest/bridge-cli-macosx.zip")
901+
const result = await bridge.getBridgeVersionFromLatestURL("https://artifactory.internal.synopsys.com/artifactory/clops-local/clops.sig.synopsys.com/bridge/binaries/bridge-cli-bundle-macosx.zip")
902902
expect(result).contains('0.2.35')
903903

904904
})
@@ -919,7 +919,7 @@ describe("Download Bridge", () => {
919919
} as any);
920920

921921

922-
const result = await bridge.getBridgeVersionFromLatestURL("https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/bridge-cli/latest/bridge-cli-macosx.zip")
922+
const result = await bridge.getBridgeVersionFromLatestURL("https://artifactory.internal.synopsys.com/artifactory/clops-local/clops.sig.synopsys.com/bridge/binaries/bridge-cli-bundle-macosx.zip")
923923
expect(result).contains('')
924924
})
925925

@@ -938,7 +938,7 @@ describe("Download Bridge", () => {
938938
get: httpClientStub,
939939
} as any);
940940

941-
const result = await bridge.getBridgeVersionFromLatestURL("https://repo.blackduck.com/bds-integrations-release/com/blackduck/integration/bridge-cli/latest/bridge-cli-macosx.zip")
941+
const result = await bridge.getBridgeVersionFromLatestURL("https://artifactory.internal.synopsys.com/artifactory/clops-local/clops.sig.synopsys.com/bridge/binaries/bridge-cli-bundle-macosx.zip")
942942
expect(result).contains('')
943943
})
944944
})

0 commit comments

Comments
 (0)