Skip to content

Commit

Permalink
commit service definition on the marketplace
Browse files Browse the repository at this point in the history
  • Loading branch information
antho1404 committed Apr 8, 2019
1 parent 2fd1b29 commit 9b65307
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions commands/marketplace_publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ func (c *marketplacePublishCmd) preRunE(cmd *cobra.Command, args []string) error
if err != nil {
return err
}
fmt.Printf("%s Service deployed with sid %s and hash %s\n", pretty.SuccessSign, pretty.Success(c.service.Sid), pretty.Success(c.service.Hash))
fmt.Printf("%s Service deployed with sid %s and hash %s\n", pretty.SuccessSign, pretty.Success(c.service.Definition.Sid), pretty.Success(c.service.Definition.Hash))

var confirmed bool
if err := survey.AskOne(&survey.Confirm{
Message: fmt.Sprintf("Are you sure to publish a new version of service %q from path %q using account %q?", c.service.Sid, c.path, c.account),
Message: fmt.Sprintf("Are you sure to publish a new version of service %q from path %q using account %q?", c.service.Definition.Sid, c.path, c.account),
}, &confirmed, nil); err != nil {
return err
}
Expand Down Expand Up @@ -90,8 +90,8 @@ func (c *marketplacePublishCmd) runE(cmd *cobra.Command, args []string) error {
}
pretty.Progress("Publishing service on the marketplace...", func() {
tx, err = c.e.PublishServiceVersion(provider.MarketplaceManifestServiceData{
Definition: c.service,
Hash: c.service.Hash,
Definition: c.service.Definition,
Hash: c.service.Definition.Hash,
HashVersion: marketplaceServiceHashVersion,
Readme: readme,
Deployment: deployment,
Expand All @@ -105,9 +105,9 @@ func (c *marketplacePublishCmd) runE(cmd *cobra.Command, args []string) error {
return err
}
fmt.Printf("%s Service published with success\n", pretty.SuccessSign)
fmt.Printf("%s See it on the marketplace: https://marketplace.mesg.com/services/%s\n", pretty.SuccessSign, c.service.Sid)
fmt.Printf("%s See it on the marketplace: https://marketplace.mesg.com/services/%s\n", pretty.SuccessSign, c.service.Definition.Sid)

fmt.Printf("%s To create a service offer, execute the command:\n\tmesg-core marketplace create-offer %s\n", pretty.SuccessSign, c.service.Sid)
fmt.Printf("%s To create a service offer, execute the command:\n\tmesg-core marketplace create-offer %s\n", pretty.SuccessSign, c.service.Definition.Sid)

return nil
}
4 changes: 2 additions & 2 deletions commands/provider/marketplace_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package provider
import (
"encoding/json"

"github.com/mesg-foundation/core/protobuf/coreapi"
"github.com/mesg-foundation/core/protobuf/definition"
)

const (
Expand Down Expand Up @@ -54,7 +54,7 @@ type MarketplaceDeployedSource struct {

// MarketplaceManifestServiceData is the data present to the manifest and sent to create a new service's version
type MarketplaceManifestServiceData struct {
Definition *coreapi.Service `json:"definition"`
Definition *definition.Service `json:"definition"`
Readme string `json:"readme,omitempty"`
Hash string `json:"hash"`
HashVersion string `json:"hashVersion"`
Expand Down

0 comments on commit 9b65307

Please sign in to comment.