-
-
Notifications
You must be signed in to change notification settings - Fork 579
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
Allow Users to Create and Trigger Arbitrary Hooks #638
Comments
Our use case is e.g. to be able to easily run tests (unit/functional...) in the container.
and I would love to be able to shorten that to:
or sth similar.
I've tried to work it around to create a script in post-start hook to make the custom command available, but the file was not created. My hook was:
|
just to provide an idea how we would might use it:
This would make it very easy for developers to onboard, as very common tasks are abstracted into a very transparent way |
I don't think you'd want to run ddev inside an exec-host, but just to mention here as in Slack: Some of these things are easily done by adding scripts in the repo. So in a scripts directory for example, a gitsetup.sh script could do your git setup, and you could have |
the idea was to provide an consistent entry point for devs ... so maybe i will stick with composer scripts for now ... but this feels weird too ... |
thought this was the goal of the project, if I'm on the wrong track please tell me. |
This is a big topic and related to customer requests on our hosting product. Tagging "needs decision" because there are likely other considerations that need to be addressed as well. |
currently we changed it to integrate it into composer.json ... so it might be not important anymore (atleast for TYPO3) |
We are currently running into the same problem. We have some commands that needs to run in a container for our frontend developers. Especially webpack or linting commands. Our frontend developers are not experienced with command line, so we want to provide simple commands for them. Currently, we put all the necessary commands in a readme file so that they can copy&paste the commands. We do not want to create a separate shell script for the commands, because we want to support the major platforms because of freelancers. To do so, we would have to create a shell and batch file and keep them in sync. So it would be nice to define custom commands inside ddev config to improve working with ddev for people, that are not experienced with command line. They need to focus on their work and not learning what containers the project provides and what options the exec command has and also what's the document root inside the container. |
Just an FYI here, if you need to use shell builtins (like environment variable setting, 'cd', 'echo', '&&', '||', shell redirection, and any other shell builtin that is not an actual command that can be found with Examples in https://stackoverflow.com/questions/50971602/how-can-i-use-bash-constructs-like-cd-or-with-ddev-exec |
@rfay about
I agree that running ddev inside an exec-host is not good. But in some cases this example might make sense. What about a ddev-host command which eventually can only be run inside an exec-host hook and is aware of that context? With that it might be possible to provide some dynamic environment variables extracted from host information into the containers before they are started as well. That for example would make my setup we discussed much easier where m pre-start host script writes the extracted information in some files inside the .ddev folder which then can be accessed and applied by the pre-start exec script inside the container. I would not even need a exec hook then because I could use |
It looks to me like custom commands have met the needs expressed here, people use them extensively. Also, there are now pre/post hooks for many, many things. Closing, happy to continue the conversation or reopen if I've missed the point. |
What happened (or feature request):
Feature Request
What you expected to happen:
ddev hook insert-task-key
where "insert-task-key" would be stored in .ddev/config.yml under the "hooks" key.Please use a complexity rating of 1-5 (5 is high) for a feature request. (High complexity implies more PR planning)
3
The text was updated successfully, but these errors were encountered: