-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.ts
55 lines (52 loc) · 1.96 KB
/
build.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// We import build-only modules directly instead of using deps.ts to keep them out of Docker container
import * as giac from "https://denopkg.com/gov-suite/[email protected]/core/mod.ts";
import * as iacModel from "https://denopkg.com/gov-suite/[email protected]/models/service/deno.service.giac.ts";
// import * as giac from "../../../../../github.com/gov-suite/governed-iac/core/mod.ts";
// import * as iacModel from "../../../../../github.com/gov-suite/governed-iac/models/service/deno.service.giac.ts";
import * as ap from "https://denopkg.com/shah/[email protected]/mod.ts";
import * as cm from "https://denopkg.com/shah/[email protected]/mod.ts";
import * as sm from "https://denopkg.com/shah/[email protected]/mod.ts";
import { shcGH } from "./deps-test.ts";
const mggRepo = shcGH.GitHub.singleton.repo(
{ org: "medigy", repo: "governance" },
);
const mggRepoLatestTag = await mggRepo.repoLatestTag();
if (!mggRepoLatestTag) {
throw new Error("Unable to detect latest version of governed-text-template");
}
const ctx = cm.ctxFactory.projectContext(".");
const port = 8159;
const mgctl =
`https://denopkg.com/medigy/governance@${mggRepoLatestTag.identity}/mgctl.ts`;
giac.dockerTr.transformDockerArtifacts(
{
projectCtx: ctx,
name: "graph",
spec: sm.specFactory.spec<giac.ConfiguredServices>(
new iacModel.DenoServicesConfig(
ctx,
iacModel.denoServiceOptions({
imageTag: "medigy_governance",
port: port,
cacheURLs: ["deps.ts", mgctl],
entryPoint: [
"/deno",
"run",
"-A",
"--unstable",
mgctl,
"server",
"--verbose",
],
}),
),
),
persist: new ap.FileSystemPersistenceHandler({
projectPath: ".",
destPath: ".",
report: ap.consolePersistenceResultReporter,
}),
composeBuildContext: ctx.projectPath,
composeYamlOptions: { lineWidth: 512 },
},
);