Allow portable drafts to publish to the connected server

This commit is contained in:
2026-10-10 02:18:48 +01:00
parent c74f7f3b41
commit 4cae37f950
12 changed files with 242 additions and 20 deletions
+11
View File
@@ -19,6 +19,17 @@ type Draft struct {
BaseVersion int `json:"base_version,omitempty"`
}
// ForServer projects publication scope onto a destination without changing the
// retained draft. Version numbers belong to the origin, not another server.
func (d Draft) ForServer(server string) Draft {
if d.Server != "" && d.Server != server {
d.CreateOnly = true
d.BaseVersion = 0
}
d.Server = server
return d
}
func Directory() (string, error) {
if dir := os.Getenv("PIPELINES_DRAFT_DIR"); dir != "" {
return filepath.Abs(dir)