Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide hooks for other commands #1071

Closed
mfrieling opened this issue Aug 21, 2018 · 2 comments · Fixed by #1634
Closed

Provide hooks for other commands #1071

mfrieling opened this issue Aug 21, 2018 · 2 comments · Fixed by #1634

Comments

@mfrieling
Copy link

Please provide hooks for commands like stop, snapshot and restore-snapshot. This would be useful e. g. to create snapshots or script other tasks before stopping or creating a files backup together with a snapshot which can be restored using ddev import-files when restoring a snapshot or starting DDEV again.

@mfrieling
Copy link
Author

A hook for post-ssh would be helpful as well to e. g. source some aliases etc. I just found out that the source command cannot be executed via a hook, neither directly (source [file] nor with sh: sh source [file]):

--- Running exec command: source /mnt/ddev_config/aliases.sh ---
Failed to start trinitec: post-start exec failed: Failed to run docker-compose [-f E:\my-project\.ddev\docker-compose.yaml -f E:\my-project\.ddev\docker-compose.ssh.yaml exec -T web source /mnt/ddev_config/aliases.sh], err='exit status 126', stdout='OCI runtime exec failed: exec failed: container_linux.go:348: starting container process caused "exec: \"source\": executable file not found in $PATH": unknown

@rfay
Copy link
Member

rfay commented Aug 21, 2018

Here's the explanation for that.. https://stackoverflow.com/q/50971602/215713

rfay added a commit that referenced this issue Jun 24, 2019
…1038 (#1634)

* Switch to yaml v3
* Add composer task
* Add multiple pre- and post- hooks
* Allow exec hook to specify container to act on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants