Skip to content

Commit ccbbb4b

Browse files
committed
Make docker generic for all tools release 5.0 update
1 parent 8accee3 commit ccbbb4b

File tree

15 files changed

+443
-210
lines changed

15 files changed

+443
-210
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

package-lock.json

Lines changed: 92 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "",
1414
"license": "ISC",
1515
"dependencies": {
16-
"axios": "^1.6.0",
16+
"axios": "^1.6.8",
1717
"commander": "^11.0.0",
1818
"dotenv": "^16.3.1"
1919
}

src/api/artifact/artifactManager.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ArtifactManager extends SnDevopsApi {
3535
}
3636

3737
else if (e.message.includes('401')) {
38-
throw new Error('The SNOW_TOKEN and SNOW_TOOLID are incorrect. Verify that the GitLab project level variables are configured.');
38+
throw new Error('The SNOW_TOKEN and SNOW_TOOLID are incorrect. Verify that the variables are configured.');
3939
}
4040

4141
else if (e.message.includes('405')) {
@@ -72,11 +72,14 @@ class ArtifactManager extends SnDevopsApi {
7272

7373
let requestPayload = {
7474
"taskExecutionNumber": BaseEnv.CI_JOB_ID,
75-
"pipelineName": BaseEnv.CI_PROJECT_PATH,
75+
"pipelineName": BaseEnv.CI_PROJECT_TITLE,
7676
"stageName": BaseEnv.CI_JOB_NAME,
77-
"gitLabProjectId": BaseEnv.CI_PROJECT_ID,
7877
"artifacts": artifacts
7978
};
79+
80+
if(BaseEnv.CI_PROJECT_ID) {
81+
requestPayload.gitLabProjectId = BaseEnv.CI_PROJECT_ID;
82+
}
8083
this.validateArtifactsPayload(requestPayload);
8184
return requestPayload;
8285

src/api/base/sndevopsApi.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ const BaseEnv = require('../../common/baseEnv')
66

77
class SndevopsApi {
88

9-
constructor(url = null, token = null, toolId = null) {
9+
constructor(url = null, token = null, toolId = null, waitForApproval = false) {
1010
this.url = url ? url : BaseEnv.SNOW_URL ;
1111
this.token = token ? token : BaseEnv.SNOW_TOKEN ;
1212
this.toolId = toolId ? toolId : BaseEnv.SNOW_TOOLID;
13+
this.waitForApproval = waitForApproval;
1314
console.log("ServiceNow Url set to " + this.url + " tool id: " + this.toolId)
1415
this.validateMandatoryParams(this.url, this.token, this.toolId);
1516
}
@@ -21,7 +22,7 @@ class SndevopsApi {
2122
if(!toolId) errorMessage += "SNOW_TOOLID is a required field.";
2223

2324
if(errorMessage) {
24-
errorMessage += " Verify that the GitLab project level variables are configured.";
25+
errorMessage += " Verify that the variables are configured.";
2526
console.error('\n \x1b[1m\x1b[31m' + errorMessage + '\x1b[0m\x1b[0m');
2627
process.exit(1);
2728
}

0 commit comments

Comments
 (0)