Skip to content

Commit d30344d

Browse files
Releasing 6.2.1 version
2 parents 02a8b64 + e539b9b commit d30344d

File tree

6 files changed

+45
-45
lines changed

6 files changed

+45
-45
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ npm unlink .
5555
### Building Docker Image
5656

5757
```sh
58-
docker build -t servicenowdocker/sndevops:6.2.0 .
58+
docker build -t servicenowdocker/sndevops:6.2.1 .
5959
```
6060

6161
```sh
62-
docker push servicenowdocker/sndevops:6.2.0
62+
docker push servicenowdocker/sndevops:6.2.1
6363
```
6464

6565
## Integrating with GitLab
@@ -122,7 +122,7 @@ stages:
122122

123123
package:
124124
stage: package
125-
image: servicenowdocker/sndevops:6.2.0
125+
image: servicenowdocker/sndevops:6.2.1
126126
variables:
127127
PROXY_ENDPOINT: "https://proxy.example.com:8080"
128128
PROXY_USERNAME: "proxy_user"
@@ -141,7 +141,7 @@ stages:
141141

142142
package:
143143
stage: package
144-
image: servicenowdocker/sndevops:6.2.0
144+
image: servicenowdocker/sndevops:6.2.1
145145
script:
146146
- sndevopscli create artifact -a '[{"name":"artifact-name","repositoryName":"artifact-repo-name" ,"version":"1.3.0"}]'
147147
- sndevopscli create package -n "package-name" -a '[{"name":"artifact-name","repositoryName":"artifact-repo-name" ,"version":"1.3.0"}]
@@ -153,7 +153,7 @@ stages:
153153

154154
package:
155155
stage: package
156-
image: servicenowdocker/sndevops:6.2.0
156+
image: servicenowdocker/sndevops:6.2.1
157157
script:
158158
- sndevopscli create artifact -u <servicenow-url> -t <tool-id> --token <tool-token> -a '[{"name":"artifact-name","repositoryName":"artifact-repo-name" ,"version":"1.3.0"}]'
159159
- sndevopscli create package -u <servicenow-url> -t <tool-id> --token <tool-token> -n "package-mame" -a '[{"name":"artifact-name","repositoryName":"artifact-repo-name" ,"version":"1.3.0"}]
@@ -177,7 +177,7 @@ stages:
177177

178178
ServiceNow DevOps Change:
179179
stage: DevOpsChangeApproval
180-
image: servicenowdocker/sndevops:6.2.0
180+
image: servicenowdocker/sndevops:6.2.1
181181
script:
182182
- sndevopscli create change -p '{"changeStepDetails":{"timeout":3600,"interval":100},"attributes":{"short_description":"Automated Software Deployment","description":"Automated Software Deployment.","assignment_group":"XXXXXXX","implementation_plan":"Software update is tested and results can be found in Test Summaries Tab.","backout_plan":"When software fails in production, the previous software release will be re-deployed.","test_plan":"Testing if the software was successfully deployed or not"}}'
183183

@@ -217,7 +217,7 @@ stages:
217217

218218
ServiceNow DevOps Sonar Scan Results:
219219
stage: DevOpsSonarStage
220-
image: servicenowdocker/sndevops:6.2.0
220+
image: servicenowdocker/sndevops:6.2.1
221221
script:
222222
- sndevopscli create sonar -url 'https://sonarcloud.io' -projectKey 'xxxxxxx' -branch 'master'
223223

@@ -242,7 +242,7 @@ stages:
242242

243243
ServiceNow DevOps Security Scan Results:
244244
stage: DevOpsSecurityScanStage
245-
image: servicenowdocker/sndevops:6.2.0
245+
image: servicenowdocker/sndevops:6.2.1
246246
script:
247247
- sndevopscli create securityScan -p "{\"pipelineInfo\":{\"buildNumber\":\"buildNumber\",\"pipelineExecutionUrl\":\"pipelineExecutionUrl\" },\"securityResultAttributes\":{ \"scanner\":\"Veracode\",\"applicationName\":\"PetStoreAPI-Github\",\"buildVersion\":\"\",\"securityToolId\":\"\"}}"
248248

@@ -270,7 +270,7 @@ stages:
270270

271271
ServiceNow DevOps Get Change:
272272
stage: DevOpsGetChange
273-
image: servicenowdocker/sndevops:6.2.0
273+
image: servicenowdocker/sndevops:6.2.1
274274
script:
275275
- sndevopscli get change -p "{\"buildNumber\":\"buildNumber\",\"stageName\":\"ServiceNow DevOps Change Step\",\"pipelineName\":\"GitlabDockerGetAndUpdateChange\"}"
276276

@@ -309,7 +309,7 @@ stages:
309309

310310
ServiceNow DevOps Update Change:
311311
stage: DevOpsUpdateChangeStage
312-
image: servicenowdocker/sndevops:6.2.0
312+
image: servicenowdocker/sndevops:6.2.1
313313
script:
314314
- sndevopscli update change -n 'CHGXXXXXX' -p "{\"short_description\":\"Automated Software Deployment\",\"description\":\"Automated Software Deployment.\",\"assignment_group\":\"XXXXX\",\"implementation_plan\":\"Software update is tested and results can be found in Test Summaries Tab.\",\"backout_plan\":\"When software fails in production, the previous software release will be re-deployed.\",\"test_plan\":\"Testing if the software was successfully deployed or not\"}"
315315

@@ -336,7 +336,7 @@ stages:
336336

337337
ServiceNow DevOps Change Step:
338338
stage: changeapproval
339-
image: servicenowdocker/sndevops:6.2.0
339+
image: servicenowdocker/sndevops:6.2.1
340340
script:
341341
- sndevopscli create change -p "{\"changeStepDetails\":{\"timeout\":3600,\"interval\":100},\"autoCloseChange\":true,\"attributes\":{\"short_description\":\"Automated Software Deployment\",\"description\":\"Automated Software Deployment.\",\"assignment_group\":\"xxxxxxxx\",\"implementation_plan\":\"Software update is tested and results can be found in Test Summaries Tab.\",\"backout_plan\":\"When software fails in production, the previous software release will be re-deployed.\",\"test_plan\":\"Testing if the software was successfully deployed or not\"}}"
342342

github-ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
runs-on: ubuntu-latest
3636
needs: build
3737
container:
38-
image: servicenowdocker/sndevops:6.2.0
38+
image: servicenowdocker/sndevops:6.2.1
3939
env:
4040
CI_JOB_NAME: "ServiceNowDevOpsChange"
4141

@@ -48,7 +48,7 @@ jobs:
4848
runs-on: ubuntu-latest
4949
needs: ServiceNowDevOpsChange
5050
container:
51-
image: servicenowdocker/sndevops:6.2.0
51+
image: servicenowdocker/sndevops:6.2.1
5252
env:
5353
CI_JOB_NAME: "ServiceNowDevOpsChange"
5454

@@ -61,7 +61,7 @@ jobs:
6161
runs-on: ubuntu-latest
6262
needs: build
6363
container:
64-
image: servicenowdocker/sndevops:6.2.0
64+
image: servicenowdocker/sndevops:6.2.1
6565
env:
6666
CI_JOB_NAME: "ArtifactAndPackage"
6767
steps:
@@ -75,7 +75,7 @@ jobs:
7575
needs: ArtifactAndPackage
7676
runs-on: ubuntu-latest
7777
container:
78-
image: servicenowdocker/sndevops:6.2.0
78+
image: servicenowdocker/sndevops:6.2.1
7979
env:
8080
CI_JOB_NAME: "ServiceNowDevOpsSonarScanResults"
8181
steps:
@@ -88,7 +88,7 @@ jobs:
8888
runs-on: ubuntu-latest
8989
needs: build
9090
container:
91-
image: servicenowdocker/sndevops:6.2.0
91+
image: servicenowdocker/sndevops:6.2.1
9292
steps:
9393
- name: security scan
9494
run: |

gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: servicenowdocker/sndevops:6.2.0
1+
image: servicenowdocker/sndevops:6.2.1
22
stages:
33
- pre-build
44
- build

harness-ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pipeline:
4545
identifier: Sonar_container
4646
spec:
4747
connectorRef: docker_connector # harness docker connector
48-
image: servicenowdocker/sndevops:6.2.0
48+
image: servicenowdocker/sndevops:6.2.1
4949
command: |-
5050
export SNOW_URL="<+variable.SNOW_URL>"
5151
export SNOW_TOOLID="<+variable.SNOW_TOOLID>"
@@ -93,7 +93,7 @@ pipeline:
9393
identifier: security
9494
spec:
9595
connectorRef: docker_connector # harness docker connector
96-
image: servicenowdocker/sndevops:6.2.0
96+
image: servicenowdocker/sndevops:6.2.1
9797
command: |-
9898
export SNOW_URL="<+variable.SNOW_URL>"
9999
export SNOW_TOOLID="<+variable.SNOW_TOOLID>"
@@ -156,7 +156,7 @@ pipeline:
156156
identifier: ServiceNow_change
157157
spec:
158158
connectorRef: docker_connector # harness docker connector
159-
image: servicenowdocker/sndevops:6.2.0
159+
image: servicenowdocker/sndevops:6.2.1
160160
command: |-
161161
# set mandetory variables. These can be set from Environment variable section of Optional configuration as well.
162162
export HARNESS_STAGE_NAME="<+stage.identifier>"

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"dependencies": {
1616
"axios": "^1.7.4",
1717
"commander": "^11.0.0",
18-
"dotenv": "^16.3.1"
18+
"dotenv": "^16.3.1",
19+
"https-proxy-agent": "^7.0.2"
1920
}
2021
}

src/api/base/sndevopsApi.js

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
const axios = require('axios');
33
const url = require('node:url');
4+
const { HttpsProxyAgent } = require('https-proxy-agent');
45
require('dotenv').config();
56
const BaseEnv = require('../../common/baseEnv')
67
const ToolHandlerRegistry = require('../../handler/registry.js');
@@ -68,29 +69,25 @@ class SndevopsApi {
6869
return null;
6970
}
7071
try {
71-
const proxyUrlObj = new URL(proxyUrl);
72-
const proxyConfig = {
73-
host: proxyUrlObj.hostname,
74-
port: proxyUrlObj.port || (proxyUrlObj.protocol === 'https:' ? 443 : 80),
75-
protocol: proxyUrlObj.protocol.replace(':', '')
76-
};
77-
72+
// Build proxy URL with authentication if provided
73+
let fullProxyUrl = proxyUrl;
74+
7875
if (proxyAuth) {
79-
proxyConfig.auth = {
80-
username: proxyAuth,
81-
password: ''
82-
};
83-
console.log(`Using proxy with API key authentication: ${proxyConfig.protocol}://${proxyConfig.host}:${proxyConfig.port}`);
76+
// If PROXY_AUTH is set, use it as the username with no password
77+
const proxyUrlObj = new URL(proxyUrl);
78+
fullProxyUrl = `${proxyUrlObj.protocol}//${proxyAuth}@${proxyUrlObj.host}`;
79+
console.log(`Using proxy with API key authentication: ${proxyUrlObj.protocol}//${proxyUrlObj.host}`);
8480
} else if (proxyUsername) {
85-
proxyConfig.auth = {
86-
username: proxyUsername,
87-
password: proxyPassword || ''
88-
};
89-
console.log(`Using proxy with username/password authentication: ${proxyConfig.protocol}://${proxyConfig.host}:${proxyConfig.port}`);
81+
// If username/password are provided
82+
const proxyUrlObj = new URL(proxyUrl);
83+
const credentials = proxyPassword ? `${proxyUsername}:${proxyPassword}` : proxyUsername;
84+
fullProxyUrl = `${proxyUrlObj.protocol}//${credentials}@${proxyUrlObj.host}`;
85+
console.log(`Using proxy with username/password authentication: ${proxyUrlObj.protocol}//${proxyUrlObj.host}`);
9086
} else {
91-
console.log(`Using proxy without authentication: ${proxyConfig.protocol}://${proxyConfig.host}:${proxyConfig.port}`);
87+
console.log(`Using proxy without authentication: ${proxyUrl}`);
9288
}
93-
return proxyConfig;
89+
90+
return fullProxyUrl;
9491
} catch (error) {
9592
console.warn(`Invalid proxy URL: ${proxyUrl}. Proceeding without proxy.`);
9693
return null;
@@ -107,13 +104,15 @@ class SndevopsApi {
107104
const axiosConfig = {
108105
headers: headers || this._getAuthHeaderWithToken()
109106
};
110-
111107
// Add proxy configuration if available
112-
const proxyConfig = this._getProxyConfig();
113-
if (proxyConfig) {
114-
axiosConfig.proxy = proxyConfig;
108+
const proxyUrl = this._getProxyConfig();
109+
if (proxyUrl) {
110+
// Use HttpsProxyAgent for HTTPS endpoints through HTTP proxy
111+
// This properly handles SSL tunneling via CONNECT method
112+
axiosConfig.httpsAgent = new HttpsProxyAgent(proxyUrl);
113+
// Set proxy to false to prevent axios from using its default proxy handling
114+
axiosConfig.proxy = false;
115115
}
116-
117116
return axiosConfig;
118117
}
119118

0 commit comments

Comments
 (0)