Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cmd/cloudshell_open/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,9 @@ func run(opts runOpts) error {
if err == nil {
// service exists
existingEnvVars, err = envVars(project, serviceName, region)
if err != nil {
return err
}
}

neededEnvs := needEnvs(appFile.Env, existingEnvVars)
Expand All @@ -346,6 +349,10 @@ func run(opts runOpts) error {

if appFile.Hooks.PreBuild.Commands != nil {
err = runScripts(appDir, appFile.Hooks.PreBuild.Commands, hookEnvs)
if err != nil {
return fmt.Errorf("attempted to run prebuild scripts and failed: %s", err)
}

}

skipBuild := appFile.Build.Skip != nil && *appFile.Build.Skip == true
Expand Down Expand Up @@ -397,6 +404,9 @@ func run(opts runOpts) error {

if appFile.Hooks.PostBuild.Commands != nil {
err = runScripts(appDir, appFile.Hooks.PostBuild.Commands, hookEnvs)
if err != nil {
return fmt.Errorf("attempted to run postbuild scripts and failed: %s", err)
}
}

if pushImage {
Expand Down