Skip to content

Commit

Permalink
feat(apps): Deploy to an environment
Browse files Browse the repository at this point in the history
  • Loading branch information
raulb committed Jan 27, 2023
1 parent 9e827cf commit d8a77b3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
13 changes: 9 additions & 4 deletions cmd/meroxa/root/apps/deploy.go
Expand Up @@ -868,6 +868,7 @@ func (d *Deploy) Execute(ctx context.Context) error {
return err
}

// SetupForDeploy is only needed for those Turbine-Core deployments (Only Ruby at the moment)
cleanup, err := d.turbineCLI.SetupForDeploy(ctx, gitSha)
if err != nil {
return err
Expand All @@ -883,16 +884,20 @@ func (d *Deploy) Execute(ctx context.Context) error {
if d.specVersion == "" && d.lang == turbine.Ruby {
d.specVersion = ir.LatestSpecVersion
}

// Intermediate Representation Workflow (if using --spec on apps deploy)
if d.specVersion != "" {
// Intermediate Representation Workflow
if err = ir.ValidateSpecVersion(d.specVersion); err != nil {
return err
}

// Creates application
app, err = d.client.CreateApplicationV2(ctx, &meroxa.CreateApplicationInput{
Name: d.appName,
Language: d.lang,
GitSha: gitSha})
Name: d.appName,
Language: d.lang,
GitSha: gitSha,
Environment: meroxa.EntityIdentifier{Name: d.flags.Environment},
})
if err != nil {
if strings.Contains(err.Error(), "already exists") {
msg := fmt.Sprintf("%s\n\tUse `meroxa apps remove %s` if you want to redeploy to this application", err, d.appName)
Expand Down
9 changes: 5 additions & 4 deletions vendor/github.com/meroxa/meroxa-go/pkg/meroxa/application.go

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

0 comments on commit d8a77b3

Please sign in to comment.