-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathTaskfile.yml
More file actions
55 lines (52 loc) · 1.65 KB
/
Taskfile.yml
File metadata and controls
55 lines (52 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
version: 3
tasks:
pkg:install:
desc: Install dependencies with available package manager
requires:
vars: [NAMES]
vars:
MANAGERS: ["yum", "apt-get", "dnf", "apk", "brew", "pacman"]
cmds:
- |
for PM in {{range .MANAGERS}}{{.}} {{end}}; do
if command -v $PM >/dev/null 2>&1; then
echo "Using $PM to install {{.NAMES}}"
case $PM in
yum) sudo yum install -y {{.NAMES}} ;;
apt-get) sudo apt-get install -y {{.NAMES}} ;;
dnf) sudo dnf install -y {{.NAMES}} ;;
apk) sudo apk add {{.NAMES}} ;;
brew) brew install {{.NAMES}} ;;
pacman) sudo pacman -S {{.NAMES}} ;;
esac
exit 0
fi
done
echo "No supported package manager found" >&2
exit 1
build:cli:
dir: ./
desc: Build the CLI
vars:
FILENAME: '{{ .FILENAME | default "install-release" }}'
ARGS: '{{ .ARGS | default "" }}'
cmds:
- mkdir -p dist
- uv run python -m nuitka --standalone --onefile --include-package=rich {{.ARGS}} --follow-imports cli/__main__.py --output-filename={{.FILENAME}}
- rm -rf __main__.build __main__.onefile-build
- mv {{.FILENAME}} dist/
test:
dir: ./test
silent: true
desc: Test the CLI in Docker (e.g. task test -- py)
cmds:
- |
if [ "{{.CLI_ARGS}}" = "" ]; then
echo "No arguments provided"
exit 1
elif [ "{{.CLI_ARGS}}" = "py" ]; then
(docker ps | grep ir-*) || bash setup.sh ubuntu
uv run pytest -s .
else
bash setup.sh {{.CLI_ARGS}}
fi