@elmohq/cli 0.2.7 → 0.2.8

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 +10 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -939,6 +939,7 @@ function buildComposeYaml(options) {
939
939
  if (options.postgresMode === "docker") {
940
940
  services.push(buildPostgresService());
941
941
  services.push(buildDbMigrateService({
942
+ dev: options.dev,
942
943
  dockerfilePath,
943
944
  repoRoot: options.repoRoot,
944
945
  }));
@@ -991,18 +992,15 @@ function buildPostgresService() {
991
992
  ].join("\n");
992
993
  }
993
994
  function buildDbMigrateService(options) {
994
- return [
995
- "db-migrate:",
996
- " build:",
997
- ` context: ${options.repoRoot}`,
998
- ` dockerfile: ${options.dockerfilePath}`,
999
- " target: migrate",
1000
- " environment:",
1001
- " - DATABASE_URL=postgres://postgres:postgres@postgres:5432/elmo",
1002
- " depends_on:",
1003
- " postgres:",
1004
- " condition: service_healthy",
1005
- ].join("\n");
995
+ const lines = ["db-migrate:"];
996
+ if (options.dev) {
997
+ lines.push(" build:", ` context: ${options.repoRoot}`, ` dockerfile: ${options.dockerfilePath}`, " target: migrate");
998
+ }
999
+ else {
1000
+ lines.push(" image: elmohq/elmo-db-migrate:latest");
1001
+ }
1002
+ lines.push(" environment:", " - DATABASE_URL=postgres://postgres:postgres@postgres:5432/elmo", " depends_on:", " postgres:", " condition: service_healthy");
1003
+ return lines.join("\n");
1006
1004
  }
1007
1005
  function buildWebService(options) {
1008
1006
  const lines = ["web:"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elmohq/cli",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "license": "AGPL-3.0-or-later",
5
5
  "keywords": [
6
6
  "marketing",