-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
49 lines (38 loc) · 1.38 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
export project_root := `git rev-parse --show-toplevel`
_default:
@just --list --list-heading $'Available commands:\n' --list-prefix $' - '
# Check just Syntax
just-check:
#!/usr/bin/bash
find "${project_root}" -type f -name "*.just" | while read -r file; do
echo "Checking syntax: $file"
just --unstable --fmt --check -f $file
done
echo "Checking syntax: ${project_root}/justfile"
just --unstable --fmt --check -f ${project_root}/justfile
# Fix just Syntax
just-fix:
#!/usr/bin/bash
find "${project_root}" -type f -name "*.just" | while read -r file; do
echo "Checking syntax: $file"
just --unstable --fmt -f $file
done
echo "Checking syntax: ${project_root}/justfile"
just --unstable --fmt -f ${project_root}/justfile || { exit 1; }
get-recipe ref:
#!/usr/bin/env nu
# ref = image:tag
let ref = '{{ ref }}'
let image = $ref | split row ':' | get 0
let tag = $ref | split row ':' | get 1
let channel = $tag | split row '-' | get 0
let recipe = $"{{ project_root }}/recipes/images/($image)/($channel)/($image)--($tag).yml"
print $recipe
# Build local image from recipe
build ref:
#!/usr/bin/env nu
bluebuild build (just get-recipe {{ ref }})
# Create ISO from ghcr image (outputs to ./build/)
build-iso-ghcr ref:
#!/usr/bin/env nu
{{ project_root }}/just_scripts/build-iso-ghcr.nu {{ ref }}