-
-
Notifications
You must be signed in to change notification settings - Fork 579
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…1038 (#1634) * Switch to yaml v3 * Add composer task * Add multiple pre- and post- hooks * Allow exec hook to specify container to act on
- Loading branch information
Showing
43 changed files
with
11,656 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package ddevapp | ||
|
||
import ( | ||
"fmt" | ||
"github.com/drud/ddev/pkg/fileutil" | ||
"github.com/drud/ddev/pkg/nodeps" | ||
"runtime" | ||
"strings" | ||
) | ||
|
||
// Composer runs composer commands in the web container, managing pre- and post- hooks | ||
func (app *DdevApp) Composer(args []string) (string, string, error) { | ||
err := app.ProcessHooks("pre-composer") | ||
if err != nil { | ||
return "", "", fmt.Errorf("Failed to process pre-composer hooks: %v", err) | ||
} | ||
|
||
stdout, stderr, err := app.Exec(&ExecOpts{ | ||
Service: "web", | ||
Dir: "/var/www/html", | ||
Cmd: fmt.Sprintf("composer %s", strings.Join(args, " ")), | ||
}) | ||
if err != nil { | ||
return stdout, stderr, fmt.Errorf("composer command failed: %v", err) | ||
} | ||
|
||
if runtime.GOOS == "windows" && !nodeps.IsDockerToolbox() { | ||
fileutil.ReplaceSimulatedLinks(app.AppRoot) | ||
} | ||
err = app.ProcessHooks("post-composer") | ||
if err != nil { | ||
return stdout, stderr, fmt.Errorf("Failed to process post-composer hooks: %v", err) | ||
} | ||
return stdout, stderr, nil | ||
|
||
} |
Oops, something went wrong.