-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjustfile
55 lines (43 loc) · 1.8 KB
/
justfile
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
set dotenv-load
# Use custom work_dir for kas, so the folder can be added to the gitignore list
# but keep the build dir under <project>/build
export KAS_WORK_DIR := env_var_or_default("KAS_WORK_DIR", justfile_directory() + "/_kas")
export KAS_BUILD_DIR := env_var_or_default("KAS_BUILD_DIR", justfile_directory() + "/build")
# Use an auto generated image version suffix (based on date) if one is not provided
export IMAGE_VERSION := env_var_or_default("IMAGE_VERSION", "" + `date +%Y%m%d.%H%M`)
export IMAGE_VERSION_SUFFIX := "_" + IMAGE_VERSION
# Init build folders
init:
mkdir -p "{{KAS_WORK_DIR}}"
mkdir -p "{{KAS_BUILD_DIR}}"
# Generate a build version
generate-version:
@echo "{{IMAGE_VERSION_SUFFIX}}"
# Clean temp build folder
clean:
@echo "Cleaning tmp folder"
rm -rf build/tmp
# Clean all build and yocto folders
clean-all:
@echo "Cleaning all local yocto folders"
rm -rf build
rm -rf _kas
# Update project lock file to lock to specific commit per layer
# You need to run this if you are working on a branch and would like up-to-date
# changes
update-lock file *args="": init
python3 -m kas dump --update --lock {{args}} {{file}} --inplace
# Build project from a given file
build-project file *args="": init
python3 -m kas build {{file}} {{args}}
# Run custom bitbake command with a given project
bitbake file *args="": init
python3 -m kas shell {{file}} -c 'bitbake {{args}}'
# Publish image to Cumulocity IoT (requires go-c8y-cli to be installed)
publish *args="":
{{justfile_directory()}}/scripts/publish-c8y.sh {{args}}
runqemu config="./projects/tedge-rauc.yaml":
kas shell {{config}} -c 'runqemu'
# Update the lock files of all projects
update-all-locks:
find ./projects -maxdepth 1 \( -name "*.yaml" -a ! -name "*.lock.*" \) -exec just update-lock {} \;