You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by back-2-95 November 1, 2021
Currently including a taskfile will result namespacing for commands in that file. Example:
includes:
foobar: ./tools/task/Taskfile.yml
Will have commands liketask foobar:something.
Is it be possible to include taskfile and declare tasks to be without namespace?
Other thing:
Can including be optional? E.g. if VARIABLE=1 then include some taskfile.
This usecase came up on me today and it'd be great to have this option.
For example, I'd like to group my tasks over multiple files according to functionality, but not add a namespace to them:
# tasks/Taskfile.cron.ymlversion: "3"tasks:
install-cronjob:
desc: "Installs a cron job to start the scrapping service at a specific schedule (Production)"cmds:
- mkdir -p ~/log/cityscrape
- echo '{{.CRON_SCHEDULE}} cd {{.PWD}} && task up-distributed-prod -- --build >> ~/log/cityscrape/house-$(date +\%Y\%m\%d\%H\%M\%S).log 2>&1' | crontab -uninstall-cronjob:
desc: "Removes the installed cron job"cmds:
- crontab -r
- echo "Cron job has been removed."reinstall-cronjob:
desc: "Reinstalls the cron job"deps:
- uninstall-cronjob
- install-cronjob# ----------------------# Taskfile.ymlversion: "3"includes:
cron:
taskfile: tasks/Taskfile.cron.yml
I could just call my cron tasks install, uninstall, reinstall and invoke them with the cron namespace, but it feels like workaround and causes ambiguous task names. Naming a task "install" doesn't reflect that it actually only install's the cronjob. I'd like to be able to specify tasks directly onto the root namespace over different files. This way I can have separated files for each functionality, but also have the conveniance of having all of them available on the root namespace.
The text was updated successfully, but these errors were encountered:
Following this discussion:
Discussed in #595
Originally posted by back-2-95 November 1, 2021
Currently including a taskfile will result namespacing for commands in that file. Example:
Will have commands like
task foobar:something
.Is it be possible to include taskfile and declare tasks to be without namespace?
Other thing:
Can including be optional? E.g. if VARIABLE=1 then include some taskfile.
This usecase came up on me today and it'd be great to have this option.
For example, I'd like to group my tasks over multiple files according to functionality, but not add a namespace to them:
I could just call my cron tasks
install
,uninstall
,reinstall
and invoke them with thecron
namespace, but it feels like workaround and causes ambiguous task names. Naming a task "install" doesn't reflect that it actually only install's the cronjob. I'd like to be able to specify tasks directly onto the root namespace over different files. This way I can have separated files for each functionality, but also have the conveniance of having all of them available on the root namespace.The text was updated successfully, but these errors were encountered: