dokku-compose 0.6.4 → 0.6.6

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.
Files changed (2) hide show
  1. package/dist/index.js +21 -13
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -142,6 +142,11 @@ function createRunner(opts = {}) {
142
142
  const result = await execa("dokku", args);
143
143
  return { stdout: result.stdout, ok: true };
144
144
  } catch (e) {
145
+ if (process.env.DOKKU_COMPOSE_DEBUG) {
146
+ console.error(`[debug] execDokku error for: dokku ${args.join(" ")}`);
147
+ console.error(`[debug] exit code: ${e.exitCode}, stderr: ${(e.stderr ?? "").slice(0, 200)}`);
148
+ console.error(`[debug] stdout length: ${(e.stdout ?? "").length}`);
149
+ }
145
150
  return { stdout: e.stdout ?? "", ok: false };
146
151
  }
147
152
  }
@@ -157,6 +162,9 @@ function createRunner(opts = {}) {
157
162
  },
158
163
  async query(...args) {
159
164
  const { stdout } = await execDokku(args);
165
+ if (process.env.DOKKU_COMPOSE_DEBUG && args[0]?.includes("builder-dockerfile")) {
166
+ console.error(`[debug] query ${args.join(" ")} => ${stdout.length} bytes`);
167
+ }
160
168
  return stdout.trim();
161
169
  },
162
170
  async check(...args) {
@@ -182,9 +190,13 @@ function createContext(runner) {
182
190
  runner,
183
191
  query(...args) {
184
192
  const key = args.join("\0");
185
- if (!cache.has(key)) {
193
+ const cached = cache.has(key);
194
+ if (!cached) {
186
195
  cache.set(key, runner.query(...args));
187
196
  }
197
+ if (process.env.DOKKU_COMPOSE_DEBUG && args[0]?.includes("builder-dockerfile")) {
198
+ console.error(`[debug] ctx.query(${args.join(" ")}) cached=${cached}`);
199
+ }
188
200
  return cache.get(key);
189
201
  },
190
202
  check(...args) {
@@ -556,12 +568,10 @@ function buildConfigFromReports(builderReport, dockerfileReport, appJsonReport,
556
568
  var Builder = {
557
569
  key: "build",
558
570
  async read(ctx, target) {
559
- const [builderRaw, dockerfileRaw, appJsonRaw, dockerOptsRaw] = await Promise.all([
560
- ctx.query("builder:report", target),
561
- ctx.query("builder-dockerfile:report", target),
562
- ctx.query("app-json:report", target),
563
- ctx.query("docker-options:report", target)
564
- ]);
571
+ const builderRaw = await ctx.query("builder:report", target);
572
+ const dockerfileRaw = await ctx.query("builder-dockerfile:report", target);
573
+ const appJsonRaw = await ctx.query("app-json:report", target);
574
+ const dockerOptsRaw = await ctx.query("docker-options:report", target);
565
575
  const dockerOptsReport = parseReport(dockerOptsRaw, "docker-options");
566
576
  return buildConfigFromReports(
567
577
  parseReport(builderRaw, "builder"),
@@ -571,12 +581,10 @@ var Builder = {
571
581
  );
572
582
  },
573
583
  async readAll(ctx) {
574
- const [builderRaw, dockerfileRaw, appJsonRaw, dockerOptsRaw] = await Promise.all([
575
- ctx.query("builder:report"),
576
- ctx.query("builder-dockerfile:report"),
577
- ctx.query("app-json:report"),
578
- ctx.query("docker-options:report")
579
- ]);
584
+ const builderRaw = await ctx.query("builder:report");
585
+ const dockerfileRaw = await ctx.query("builder-dockerfile:report");
586
+ const appJsonRaw = await ctx.query("app-json:report");
587
+ const dockerOptsRaw = await ctx.query("docker-options:report");
580
588
  const builderBulk = parseBulkReport(builderRaw, "builder");
581
589
  const dockerfileBulk = parseBulkReport(dockerfileRaw, "builder-dockerfile");
582
590
  const appJsonBulk = parseBulkReport(appJsonRaw, "app-json");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dokku-compose",
3
- "version": "0.6.4",
3
+ "version": "0.6.6",
4
4
  "description": "Docker Compose for Dokku — declare your entire server in a single YAML file.",
5
5
  "main": "dist/index.js",
6
6
  "exports": "./dist/index.js",