@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.
- package/dist/index.js +10 -12
- 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
|
-
|
|
995
|
-
|
|
996
|
-
" build:",
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
"
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
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:"];
|