feat: base volume path setting
Add global base_volume_path to settings. Relative volume source paths are automatically prepended with the base path at deploy time. Absolute paths are used as-is. Configurable in Settings > General.
This commit is contained in:
@@ -707,9 +707,19 @@ func (d *Deployer) computeVolumeMounts(projectID, stageName, imageTag string) []
|
||||
return nil
|
||||
}
|
||||
|
||||
// Get base volume path from settings.
|
||||
basePath := ""
|
||||
if settings, err := d.store.GetSettings(); err == nil {
|
||||
basePath = settings.BaseVolumePath
|
||||
}
|
||||
|
||||
mounts := make([]mount.Mount, 0, len(vols))
|
||||
for _, vol := range vols {
|
||||
source := vol.Source
|
||||
// Prepend base path if source is relative (doesn't start with /).
|
||||
if basePath != "" && !filepath.IsAbs(source) {
|
||||
source = filepath.Join(basePath, source)
|
||||
}
|
||||
if vol.Mode == "isolated" {
|
||||
source = filepath.Join(source, fmt.Sprintf("%s-%s", stageName, imageTag))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user