dtu-github-actions 0.4.0 → 0.6.0
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/dist/ephemeral.d.ts +3 -1
- package/dist/ephemeral.js +10 -2
- package/package.json +9 -2
package/dist/ephemeral.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export interface EphemeralDtu {
|
|
2
|
-
/** Full URL including port, e.g. "http://127.0.0.1:49823" */
|
|
2
|
+
/** Full URL including port for CLI access (127.0.0.1), e.g. "http://127.0.0.1:49823" */
|
|
3
3
|
url: string;
|
|
4
|
+
/** Full URL including port for container access (host IP), e.g. "http://172.17.0.1:49823" */
|
|
5
|
+
containerUrl: string;
|
|
4
6
|
port: number;
|
|
5
7
|
/** Shut down the ephemeral DTU server. */
|
|
6
8
|
close(): Promise<void>;
|
package/dist/ephemeral.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import http from "node:http";
|
|
2
2
|
import { setCacheDir } from "./server/store.js";
|
|
3
3
|
import { bootstrapAndReturnApp } from "./server/index.js";
|
|
4
|
+
function resolveContainerHost() {
|
|
5
|
+
const configuredHost = process.env.AGENT_CI_DTU_HOST?.trim();
|
|
6
|
+
return configuredHost || "host.docker.internal";
|
|
7
|
+
}
|
|
4
8
|
/**
|
|
5
9
|
* Start an ephemeral in-process DTU server on a random OS-assigned port.
|
|
6
10
|
*
|
|
@@ -31,9 +35,13 @@ export async function startEphemeralDtu(cacheDir) {
|
|
|
31
35
|
});
|
|
32
36
|
server.on("error", reject);
|
|
33
37
|
});
|
|
34
|
-
|
|
38
|
+
// Use 127.0.0.1 for CLI access (same host) and host IP for container access
|
|
39
|
+
const containerHost = resolveContainerHost();
|
|
40
|
+
const cliUrl = `http://127.0.0.1:${port}`;
|
|
41
|
+
const containerUrl = `http://${containerHost}:${port}`;
|
|
35
42
|
return {
|
|
36
|
-
url,
|
|
43
|
+
url: cliUrl,
|
|
44
|
+
containerUrl,
|
|
37
45
|
port,
|
|
38
46
|
close() {
|
|
39
47
|
return new Promise((resolve) => {
|
package/package.json
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dtu-github-actions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Digital Twin Universe - GitHub Actions Mock and Simulation",
|
|
5
|
-
"keywords": [
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ci",
|
|
7
|
+
"digital-twin",
|
|
8
|
+
"github-actions",
|
|
9
|
+
"mock",
|
|
10
|
+
"simulation",
|
|
11
|
+
"testing"
|
|
12
|
+
],
|
|
6
13
|
"license": "FSL-1.1-MIT",
|
|
7
14
|
"author": "",
|
|
8
15
|
"repository": {
|