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

Run tasks using the run command #815

Closed
Tracked by #602
cnpryer opened this issue Nov 6, 2023 · 0 comments · Fixed by #860
Closed
Tracked by #602

Run tasks using the run command #815

cnpryer opened this issue Nov 6, 2023 · 0 comments · Fixed by #860
Assignees
Milestone

Comments

@cnpryer
Copy link
Owner

cnpryer commented Nov 6, 2023

Summary

A subcommand for running task with Huak.

Motivation

  • More centralization
  • Environment management
  • Declarative command setup
  • Task-orientation

Requirements

  • Resolution from within Huak's context
  • Any commands
  • Flexible declaration

Details

  • Table: Task Table
  • Key: Task Name
  • Value: The Task

Table

The Task Table is a child of the Huak (Tool) Table. The Task Table contains key-value pairs for commands Huak can be configured to run. Each key corresponds to an alias or name to use and values contain data for the command like a command string to execute, a list of commands to execute, environment data, and more.

Key (String): Alias/Name

The keys in this table correspond to the name/alias of the command in the Run Table. In the following example, hello-name is the name/alias for the command.

[tool.huak.task]
hello-name = { env = { NAME = "Chris" }, cmd = "python scripts/hello_name.py" }

Value

  • One(Task)
  • Many(Tasks)
[tool.huak.task]
run-all-tasks = { env = { MY_VAR = "all" }, chain = ["task-one", "task-two", "exec-py-file", "multiple-other"] } 
task-one = "rm -rf some/path"
task-two = ["python",  "path/to/file.py"]
task-three = { env = { MY_VAR = "task three" }, cmd = "python path/to/file.py" }
task-four = { program = "program", args = ["some", "args"] }

Using the Task Table

[tool.huak.task]
hello-name = { env = { NAME = "Chris" }, cmd = "python scripts/hello_name.py" }
huak run hello-name
huak run python -c 'print("Hello, Chris")'
@cnpryer cnpryer added this to the General-use release milestone Nov 6, 2023
@cnpryer cnpryer mentioned this issue Nov 6, 2023
28 tasks
@cnpryer cnpryer self-assigned this Nov 19, 2023
@cnpryer cnpryer changed the title Huak run command Update Run command Nov 20, 2023
@cnpryer cnpryer changed the title Update Run command Update run command Nov 20, 2023
@cnpryer cnpryer changed the title Update run command Run tasks using the run command Nov 20, 2023
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.

1 participant