DodoApp: Prepare dodo-app to support multiple app repositories
Previously Git repository storing configuration for PCloud
environment, linked dodo-app repositories directly. After this change,
dodo-app will first create config repository which will link
individual application repositories. And PCloud env will link to the
config repo. That way dodo-app manger will be able to create multiple
app repositories per installation.
Change-Id: I647cacda7a9a4f241d2acc28ae5d8bbd8c6424d6
diff --git a/apps/app-runner/server.go b/apps/app-runner/server.go
index 865f724..7985ac6 100644
--- a/apps/app-runner/server.go
+++ b/apps/app-runner/server.go
@@ -16,6 +16,7 @@
type Server struct {
l sync.Locker
port int
+ appId string
ready bool
cmd *exec.Cmd
repoAddr string
@@ -26,11 +27,12 @@
manager string
}
-func NewServer(port int, repoAddr string, signer ssh.Signer, appDir string, runCommands []Command, self string, manager string) *Server {
+func NewServer(port int, appId string, repoAddr string, signer ssh.Signer, appDir string, runCommands []Command, self string, manager string) *Server {
return &Server{
l: &sync.Mutex{},
port: port,
ready: false,
+ appId: appId,
repoAddr: repoAddr,
signer: signer,
appDir: appDir,
@@ -118,6 +120,7 @@
}
type pingReq struct {
+ AppId string `json:"appId"`
Address string `json:"address"`
}
@@ -128,7 +131,7 @@
s.pingManager()
}()
}()
- buf, err := json.Marshal(pingReq{s.self})
+ buf, err := json.Marshal(pingReq{s.appId, s.self})
if err != nil {
return
}