We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5394d09 commit d8ded69Copy full SHA for d8ded69
README.md
@@ -289,6 +289,7 @@ Full documentation is available at [docs.daguit.dev](https://docs.daguit.dev/).
289
|---------------------|---------|-------------|
290
| `DAGU_HOME` | - | Base directory that overrides all path configurations |
291
| `DAGU_DAGS_DIR` | `~/.config/dagu/dags` | Directory for DAG definitions |
292
+| `DAGU_ALT_DAGS_DIR` | - | Additional directory to search for DAG definitions |
293
| `DAGU_LOG_DIR` | `~/.local/share/dagu/logs` | Directory for log files |
294
| `DAGU_DATA_DIR` | `~/.local/share/dagu/data` | Directory for application data |
295
| `DAGU_SUSPEND_FLAGS_DIR` | `~/.local/share/dagu/suspend` | Directory for suspend flags |
internal/cmd/context.go
@@ -377,10 +377,16 @@ type dagStoreConfig struct {
377
378
// dagStore returns a new DAGRepository instance.
379
func (c *Context) dagStore(cfg dagStoreConfig) (exec.DAGStore, error) {
380
+ // Merge configured alternate DAGs directory into search paths if provided
381
+ searchPaths := append([]string{}, cfg.SearchPaths...)
382
+ if c.Config != nil && c.Config.Paths.AltDAGsDir != "" {
383
+ searchPaths = append(searchPaths, c.Config.Paths.AltDAGsDir)
384
+ }
385
+
386
store := filedag.New(
387
c.Config.Paths.DAGsDir,
388
filedag.WithFlagsBaseDir(c.Config.Paths.SuspendFlagsDir),
- filedag.WithSearchPaths(cfg.SearchPaths),
389
+ filedag.WithSearchPaths(searchPaths),
390
filedag.WithFileCache(cfg.Cache),
391
filedag.WithSkipExamples(c.Config.Core.SkipExamples),
392
filedag.WithSkipDirectoryCreation(cfg.SkipDirectoryCreation),
internal/cmn/config/config.go
@@ -250,6 +250,7 @@ type PathsConfig struct {
250
SuspendFlagsDir string
251
AdminLogsDir string
252
BaseConfig string
253
+ AltDAGsDir string
254
DAGRunsDir string
255
QueueDir string
256
ProcDir string
internal/cmn/config/definition.go
@@ -181,6 +181,7 @@ type PathsDef struct {
181
SuspendFlagsDir string `mapstructure:"suspendFlagsDir"`
182
AdminLogsDir string `mapstructure:"adminLogsDir"`
183
BaseConfig string `mapstructure:"baseConfig"`
184
+ AltDagsDir string `mapstructure:"altDagsDir"`
185
DAGRunsDir string `mapstructure:"dagRunsDir"`
186
QueueDir string `mapstructure:"queueDir"`
187
ProcDir string `mapstructure:"procDir"`
internal/cmn/config/loader.go
@@ -312,6 +312,7 @@ func (l *ConfigLoader) loadPathsConfig(cfg *Config, def Definition) error {
312
source string
313
}{
314
{"DAGsDir", &cfg.Paths.DAGsDir, def.Paths.DAGsDir},
315
+ {"AltDAGsDir", &cfg.Paths.AltDAGsDir, def.Paths.AltDagsDir},
316
{"SuspendFlagsDir", &cfg.Paths.SuspendFlagsDir, def.Paths.SuspendFlagsDir},
317
{"DataDir", &cfg.Paths.DataDir, def.Paths.DataDir},
318
{"LogDir", &cfg.Paths.LogDir, def.Paths.LogDir},
@@ -1250,6 +1251,7 @@ var envBindings = []envBinding{
1250
1251
// Paths
1252
{key: "paths.dagsDir", env: "DAGS", isPath: true},
1253
{key: "paths.dagsDir", env: "DAGS_DIR", isPath: true},
1254
+ {key: "paths.altDagsDir", env: "ALT_DAGS_DIR", isPath: true},
1255
{key: "paths.executable", env: "EXECUTABLE", isPath: true},
1256
{key: "paths.logDir", env: "LOG_DIR", isPath: true},
1257
{key: "paths.dataDir", env: "DATA_DIR", isPath: true},
internal/cmn/config/loader_test.go
@@ -68,6 +68,7 @@ func TestLoad_Env(t *testing.T) {
68
"DAGU_PROC_DIR": filepath.Join(testPaths, "proc"),
69
"DAGU_QUEUE_DIR": filepath.Join(testPaths, "queue"),
70
"DAGU_SERVICE_REGISTRY_DIR": filepath.Join(testPaths, "service-registry"),
71
+ "DAGU_ALT_DAGS_DIR": filepath.Join(testPaths, "alt-dags"),
72
73
"DAGU_LATEST_STATUS_TODAY": "true",
74
@@ -168,6 +169,7 @@ func TestLoad_Env(t *testing.T) {
168
169
},
170
Paths: PathsConfig{
171
DAGsDir: filepath.Join(testPaths, "dags"),
172
+ AltDAGsDir: filepath.Join(testPaths, "alt-dags"),
173
Executable: filepath.Join(testPaths, "bin", "dagu"),
174
LogDir: filepath.Join(testPaths, "logs"),
175
DataDir: filepath.Join(testPaths, "data"),
0 commit comments