54 lines
1.2 KiB
YAML
54 lines
1.2 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}}
|
|
|
|
ls-enable:
|
|
desc: List all {{.ENABLED_FILE}} services
|
|
cmds:
|
|
- echo "Enabled services:"
|
|
- cat {{.ENABLED_FILE}}
|