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

Allow to watch for port being LISTENING #1936

Open
SheGe opened this issue Dec 4, 2024 · 1 comment
Open

Allow to watch for port being LISTENING #1936

SheGe opened this issue Dec 4, 2024 · 1 comment
Labels
state: needs triage Waiting to be triaged by a maintainer.

Comments

@SheGe
Copy link

SheGe commented Dec 4, 2024

At the time of creating this request, the watch: true feature does not support using anything other than sources: []. I would like to configure a task that works with the watch: true feature to check for a LISTENING port.

Ideas:

  1. Allow the watch setting to accept a boolean or a nested cmd/cmds. The result of custom shell command execution could determine when a task needs to be executed.
  2. Upgrade the watch implementation to respect the existing status setting, allowing runs of custom commands without a need to change the schema.
  3. Implement watch: true with port: 8080, where the listening check would be a part of the watch task implementation.
@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Dec 4, 2024
@trulede
Copy link

trulede commented Dec 15, 2024

You may consider #1951, here the bash command nc (netcat) and a while loop will solve your problem (any many others of a similar nature).

Having watch evaluate a tasks preconditions might be interesting. That makes some sense, since a waiting Task should not run unless a watched source file has changed AND its preconditions are satisfied. It also make things more complicated and difficult to use.

But again, the same thing can be achieved with a bash while loop, that that mechanism is well understood, and easy to adapt ... so perhaps it still a better strategy ; a precondition cmd with a bash while loop, using nc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: needs triage Waiting to be triaged by a maintainer.
Projects
None yet
Development

No branches or pull requests

3 participants