-
Notifications
You must be signed in to change notification settings - Fork 371
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
Hooks for executing custom scripts #535
Comments
Yeah, that would be great. I am now trying some scripting solution. Any idea how to script the pod selection? See also this. |
@musicformellons for which command do you try to automatically select a pod? Usually the commands have additional flags that allow you to specify a pod and prevent a select, if not we could add the parameter to the command where you need it |
@FabianKramm Ah, thanks, I found the flags and now indeed can get into my containers without the select! That's nice. When I am at the prompt of my container I can no longer script anything it seems, I am trying (with tilix terminal) e.g.: |
Hi @musicformellons! I just took a look at this script. For me, the current behavior seems correct but probably not what you intend to do with this script. From what I see the script does the following within the tilix shell:
Your issue is that 3. and the rest will never be executed. The reason for this is that 2. "devspace enter" waits for an input and 3. can never be executed until the "devspace enter" process terminates. Are you trying to run 3., 4., ... within the terminal of the container or on your local computer? Let me know what your script is meant to do and I will probably be able to help you with this. |
@LukasGentele On the terminal of the container! |
Ok, got it. If you want to run "devspace enter" and then execute something within the container terminal, you can provide it as a argument to the command. So, I would change your code like this:
the |
Ha! I tried similar things before but gave up on it as I did not get it working, but now I got it working!! With three small adjustments to your line. Working line is: So I added |
I would think the same approach would work on the |
Actually, after correcting a typo it also works with |
Great! Regarding your question in "my following requirement would be to have multiple of these lines, but make them synchronous..." - you can run several tasks in parallel in the background by using "&" at the end of the line. So this would run 3 commands in parallel:
They run in parallel but are not necessarily synchronized. They are just run in the background. I hope that helps. I think we should not continue this discussion in the comments of this issue as this is not directly related to this issue about hooks for DevSpace CLI. Feel free to ping me on slack if you have any further questions about shell scripting. |
Is part of version v3.5.1 |
It can be helpful to run user-defined commands/scripts after or before certain pipeline steps. This allows more customization of the pipeline and gives the user more freedom of integrating devspace into his own pipeline or use devspace as the primary pipeline tool.
The text was updated successfully, but these errors were encountered: