Skip to content

Commit

Permalink
Add build command in each deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
pratishshr committed Oct 23, 2019
1 parent ac26455 commit e7512a0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cli/internals/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ func Run(environment string) {
frontend.Deploy(project, environment)
}

slack.Notify(project.SlackURL, fmt.Sprintf(" 🎉 🎉 🎉 *%s* succesfully deployed to *%s*. 🎉 🎉 🎉", project.Name, environment), "#04EBB8")
slack.Notify(project.SlackURL, fmt.Sprintf("*%s* succesfully deployed to *%s*. 🎉 🎉 🎉", project.Name, environment), "#04EBB8")
}
5 changes: 3 additions & 2 deletions core/structs/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package structs

// Env defines the structure for a single environment
type Env struct {
Bucket string `json:"bucket"`
Cluster string `json:"cluster"`
Bucket string `json:"bucket"`
Cluster string `json:"cluster"`
BuildCommand string `json:"buildCommand"`
}

// Project defines the overall structure for a project deployment.
Expand Down
2 changes: 1 addition & 1 deletion core/utils/shell/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os"
"os/exec"

"github.com/leapfrogtechnology/shift/deployment/utils/escape"
"github.com/leapfrogtechnology/shift/core/utils/escape"
)

// Execute runs the process with the supplied environment.
Expand Down
7 changes: 7 additions & 0 deletions deployment/internals/frontend/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@ package frontend
import (
"github.com/leapfrogtechnology/shift/core/structs"
"github.com/leapfrogtechnology/shift/core/utils/logger"
"github.com/leapfrogtechnology/shift/core/utils/shell"
"github.com/leapfrogtechnology/shift/deployment/services/platforms/aws/s3"
)

// Deploy uploads files to S3 bucket.
func Deploy(project structs.Project, environment string) {
buildCommand := project.Env[environment].BuildCommand

if buildCommand != "" {
shell.Execute(buildCommand)
}

err := s3.Deploy(s3.Data{
Profile: project.Profile,
Region: project.Region,
Expand Down

0 comments on commit e7512a0

Please sign in to comment.