dokku-compose 0.9.1 → 0.9.3
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 +29 -9
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -68,15 +68,15 @@ var AppSchema = z.object({
|
|
|
68
68
|
git: GitSchema.optional()
|
|
69
69
|
});
|
|
70
70
|
var ServiceBackupAuthSchema = z.object({
|
|
71
|
-
access_key_id: z.string(),
|
|
72
|
-
secret_access_key: z.string(),
|
|
73
|
-
region: z.string(),
|
|
74
|
-
signature_version: z.string(),
|
|
75
|
-
endpoint: z.string()
|
|
71
|
+
access_key_id: z.string().min(1),
|
|
72
|
+
secret_access_key: z.string().min(1),
|
|
73
|
+
region: z.string().min(1),
|
|
74
|
+
signature_version: z.string().min(1),
|
|
75
|
+
endpoint: z.string().min(1)
|
|
76
76
|
});
|
|
77
77
|
var ServiceBackupSchema = z.object({
|
|
78
|
-
schedule: z.string(),
|
|
79
|
-
bucket: z.string(),
|
|
78
|
+
schedule: z.string().min(1),
|
|
79
|
+
bucket: z.string().min(1),
|
|
80
80
|
auth: ServiceBackupAuthSchema
|
|
81
81
|
});
|
|
82
82
|
var PostgresSchema = z.object({
|
|
@@ -113,7 +113,22 @@ function parseConfig(raw) {
|
|
|
113
113
|
|
|
114
114
|
// src/core/config.ts
|
|
115
115
|
function interpolateEnvVars(content) {
|
|
116
|
-
|
|
116
|
+
const missing = [];
|
|
117
|
+
const result = content.replace(/\$\{([^}]+)\}/g, (_, name) => {
|
|
118
|
+
const value = process.env[name];
|
|
119
|
+
if (value === void 0 || value === "") {
|
|
120
|
+
missing.push(name);
|
|
121
|
+
return "";
|
|
122
|
+
}
|
|
123
|
+
return value;
|
|
124
|
+
});
|
|
125
|
+
if (missing.length > 0) {
|
|
126
|
+
const unique = Array.from(new Set(missing));
|
|
127
|
+
throw new Error(
|
|
128
|
+
`Unset environment variable(s) referenced in config: ${unique.join(", ")}`
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
return result;
|
|
117
132
|
}
|
|
118
133
|
function loadConfig(filePath) {
|
|
119
134
|
if (!fs.existsSync(filePath)) {
|
|
@@ -844,7 +859,6 @@ async function ensurePostgresBackups(ctx, services) {
|
|
|
844
859
|
continue;
|
|
845
860
|
}
|
|
846
861
|
const { schedule, bucket, auth } = config.backup;
|
|
847
|
-
await ctx.run("postgres:backup-deauth", name);
|
|
848
862
|
await ctx.run(
|
|
849
863
|
"postgres:backup-auth",
|
|
850
864
|
name,
|
|
@@ -855,6 +869,12 @@ async function ensurePostgresBackups(ctx, services) {
|
|
|
855
869
|
auth.endpoint
|
|
856
870
|
);
|
|
857
871
|
await ctx.run("postgres:backup-schedule", name, schedule, bucket);
|
|
872
|
+
const cronOutput = await ctx.query("postgres:backup-schedule-cat", name);
|
|
873
|
+
if (!parseBackupSchedule(cronOutput)) {
|
|
874
|
+
throw new Error(
|
|
875
|
+
`Backup schedule for ${name} was not installed after backup-schedule ran`
|
|
876
|
+
);
|
|
877
|
+
}
|
|
858
878
|
await ctx.run("config:set", "--global", `${hashKey}=${desiredHash}`);
|
|
859
879
|
logDone();
|
|
860
880
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dokku-compose",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
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",
|
|
7
7
|
"bin": {
|
|
8
|
-
"dokku-compose": "./
|
|
8
|
+
"dokku-compose": "./bin/dokku-compose"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"dist/",
|