71 lines
1.8 KiB
YAML
71 lines
1.8 KiB
YAML
|
version: '3'
|
||
|
|
||
|
vars:
|
||
|
ENABLED_FILE: enabled
|
||
|
|
||
|
tasks:
|
||
|
enable-all:
|
||
|
desc: Enable all available services
|
||
|
cmds:
|
||
|
- rm {{.ENABLED_FILE}}
|
||
|
- touch {{.ENABLED_FILE}}
|
||
|
- |
|
||
|
for s in $(find ./services/ -type d -mindepth 1 -maxdepth 1 -print) ; do
|
||
|
echo $(basename $s) >> {{.ENABLED_FILE}}
|
||
|
done
|
||
|
- echo "Enabled services:"
|
||
|
- cat {{.ENABLED_FILE}}
|
||
|
|
||
|
disable-all:
|
||
|
desc: Disable all available services
|
||
|
cmds:
|
||
|
- rm {{.ENABLED_FILE}}
|
||
|
- touch {{.ENABLED_FILE}}
|
||
|
- echo "Enabled services:"
|
||
|
- cat {{.ENABLED_FILE}}
|
||
|
|
||
|
enable:
|
||
|
desc: Enable given services
|
||
|
cmds:
|
||
|
- |
|
||
|
for s in {{.CLI_ARGS}} ; do
|
||
|
echo " enabling $s"
|
||
|
echo "$s" >> {{.ENABLED_FILE}}
|
||
|
done
|
||
|
- sort -o {{.ENABLED_FILE}} {{.ENABLED_FILE}}
|
||
|
- echo "Enabled services:"
|
||
|
- cat {{.ENABLED_FILE}}
|
||
|
|
||
|
disable:
|
||
|
desc: Disable given services
|
||
|
cmds:
|
||
|
- |
|
||
|
for s in {{.CLI_ARGS}} ; do
|
||
|
echo " disabling $s"
|
||
|
sed -i '/$s/d' {{.ENABLED_FILE}}
|
||
|
done
|
||
|
- echo "Enabled services:"
|
||
|
- cat {{.ENABLED_FILE}}
|
||
|
|
||
|
list:
|
||
|
desc: List all {{.ENABLED_FILE}} services
|
||
|
cmds:
|
||
|
- echo "Enabled services:"
|
||
|
- cat {{.ENABLED_FILE}}
|
||
|
|
||
|
update-task:
|
||
|
desc: Download latest Taskfile binary
|
||
|
cmds:
|
||
|
- sh -c "$(wget https://taskfile.dev/install.sh -O -)" -- -d -b .
|
||
|
|
||
|
install-task:
|
||
|
desc: Install Taskfile system wide
|
||
|
cmds:
|
||
|
- sh -c "$(wget https://taskfile.dev/install.sh -O -)" -- -d -b /usr/bin
|
||
|
|
||
|
install-completion:
|
||
|
desc: Add Taskfile zsh completion
|
||
|
cmds:
|
||
|
- mkdir -p /usr/local/share/zsh/site-functions
|
||
|
- wget -O /usr/local/share/zsh/site-functions/_task https://raw.githubusercontent.com/go-task/task/master/completion/zsh/_task
|