Skip to content

Commit

Permalink
new deployment style: add default env vars & main service key to serv…
Browse files Browse the repository at this point in the history
…ice definition
  • Loading branch information
ilgooz committed Jun 4, 2019
1 parent 1517260 commit 62fba75
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 49 deletions.
8 changes: 4 additions & 4 deletions protobuf/api/service.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

98 changes: 53 additions & 45 deletions protobuf/definition/service.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions protobuf/definition/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ message Configuration {
repeated string ports = 3; // List of ports the container exposes.
repeated string args = 4; // Args to pass to the container.
string command = 5; // Command to run the container.
repeated string env = 6; // Default env vars to apply to service's instance on runtime.
}

// A dependency is a configuration of an other container that runs separately from the service.
Expand Down
3 changes: 3 additions & 0 deletions sdk/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,8 @@ func (s *Service) Create(srv *service.Service) error {
srv.Sid = "_" + srv.Hash
}

// apply main service key to service.
srv.Configuration.Key = service.MainServiceKey

return s.db.Save(srv)
}
1 change: 1 addition & 0 deletions server/grpc/api/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func fromProtoConfiguration(configuration *definition.Configuration) *service.De
Ports: configuration.Ports,
Volumes: configuration.Volumes,
VolumesFrom: configuration.VolumesFrom,
Env: configuration.Env,
}
}

Expand Down

0 comments on commit 62fba75

Please sign in to comment.