-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
57 lines (44 loc) · 1.61 KB
/
justfile
File metadata and controls
57 lines (44 loc) · 1.61 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
56
57
set dotenv-load
# Install dev dependencies
install-deps:
pip3 install .[dev]
# Format python code
format:
python3 -m black src
# Check formatting
format-check:
python3 -m black --check src
# Run linter
lint:
python3 -m pylint src
# Prepare up but don't start any containers
prepare-up *args='':
docker compose build {{args}}
# Run demo
up *args="":
docker compose up --detach --build {{args}}
# Setup and bootstrap
up-ci:
./ci/demo.sh
# Stop demo
down:
docker compose down
# Stop demo and delete any volumes
down-all:
docker compose down -v
# Configure and register the device to the cloud (requires go-c8y-cli and c8y-tedge extension)
bootstrap *args="":
c8y tedge bootstrap-container bootstrap "$DEVICE_ID" {{args}}
# Install python virtual environment
venv:
[ -d .venv ] || python3 -m venv .venv
./.venv/bin/pip3 install -r tests/requirements.txt
# Run tests
test *ARGS='':
./.venv/bin/python3 -m robot.run --outputdir output {{ARGS}} tests
# Cleanup device and all it's dependencies
cleanup DEVICE_ID $CI="true":
echo "Removing device and child devices (including certificates)"
c8y devicemanagement certificates list -n --tenant "$(c8y currenttenant get --select name --output csv)" --filter "name eq {{DEVICE_ID}}" --pageSize 2000 | c8y devicemanagement certificates delete --tenant "$(c8y currenttenant get --select name --output csv)"
c8y inventory find -n --owner "device_{{DEVICE_ID}}" -p 100 | c8y inventory delete
c8y users delete -n --id "device_{{DEVICE_ID}}" --tenant "$(c8y currenttenant get --select name --output csv)" --silentStatusCodes 404 --silentExit