installer: create individual soft-serve instances for each env
diff --git a/core/installer/repoio.go b/core/installer/repoio.go
index 54d9a7d..204caec 100644
--- a/core/installer/repoio.go
+++ b/core/installer/repoio.go
@@ -7,7 +7,6 @@
"io/fs"
"io/ioutil"
"net"
- "net/netip"
"path"
"path/filepath"
"time"
@@ -23,7 +22,7 @@
)
type RepoIO interface {
- Addr() netip.AddrPort
+ Addr() string
Fetch() error
ReadConfig() (Config, error)
ReadAppConfig(path string) (AppConfig, error)
@@ -32,6 +31,7 @@
ReadYaml(path string) (any, error)
WriteYaml(path string, data any) error
CommitAndPush(message string) error
+ WriteCommitAndPush(path, contents, message string) error
Reader(path string) (io.ReadCloser, error)
Writer(path string) (io.WriteCloser, error)
CreateDir(path string) error
@@ -54,7 +54,7 @@
}
}
-func (r *repoIO) Addr() netip.AddrPort {
+func (r *repoIO) Addr() string {
return r.repo.Addr.Addr
}
@@ -161,6 +161,18 @@
return data, err
}
+func (r *repoIO) WriteCommitAndPush(path, contents, message string) error {
+ w, err := r.Writer(path)
+ if err != nil {
+ return err
+ }
+ defer w.Close()
+ if _, err := io.WriteString(w, contents); err != nil {
+ return err
+ }
+ return r.CommitAndPush(message)
+}
+
func (r *repoIO) CommitAndPush(message string) error {
wt, err := r.repo.Worktree()
if err != nil {