forked from ublue-os/bluefin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justfile
132 lines (102 loc) · 4.6 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
export project_root := `git rev-parse --show-toplevel`
export gts := "39"
export latest := "40"
alias run := run-booted-guest
_default:
@just help
_container_mgr:
@{{ project_root }}/scripts/container_mgr.sh
_base_image image:
@{{ project_root }}/scripts/base-image.sh {{ image }}
_tag image target:
@{{ project_root }}/scripts/make-tag.sh {{ image }} {{ target }}
# 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 || { exit 1; }
done
just --unstable --fmt --check -f ${project_root}/Justfile || { exit 1; }
# Fix Just Syntax
[private]
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 || { exit 1; }
done
just --unstable --fmt -f ${project_root}/Justfile || { exit 1; }
# Build Image
build image="" target="" version="":
@{{ project_root }}/scripts/build-image.sh {{ image }} {{ target }} {{ version }}
# Run image
run-container image="" target="" version="":
@{{ project_root }}/scripts/run-image.sh {{ image }} {{ target }} {{ version }}
# Run Booted Image Session w/ Guest
run-booted-guest image="" target="" version="":
@{{ project_root }}/scripts/run-booted-guest.sh {{ image }} {{ target }} {{ version }}
# Run Booted Image Session w/ mounted in $USER and $HOME
run-booted-home image="" target="" version="":
@{{ project_root }}/scripts/run-booted-home.sh {{ image }} {{ target }} {{ version }}
# Create ISO from local dev build image
build-iso image="" target="" version="":
@{{ project_root }}/scripts/build-iso.sh {{ image }} {{ target }} {{ version }}
# Run ISO from local dev build image
run-iso image="" target="" version="":
@{{ project_root }}/scripts/run-iso.sh {{ image }} {{ target }} {{ version }}
# Create ISO from currenct ghcr image
build-iso-ghcr image="" target="" version="":
@{{ project_root }}/scripts/build-iso-ghcr.sh {{ image }} {{ target }} {{ version }}
# Clean Directory. Remove ISOs and Build Files
clean:
@{{ project_root }}/scripts/cleanup-dir.sh
# Remove built images
clean-images:
@{{ project_root }}/scripts/cleanup-images.sh
# List Built Images
list-images:
@{{ project_root }}/scripts/list-images.sh
[private]
help:
#!/usr/bin/bash
echo " "
echo "These are helper scripts for building and testing development images "
echo " "
echo "You can run dev images either in 'booted like' setup with 'just run-booted' "
echo "Or in a more stripped down version with 'just run' "
echo "Specify which image you wish to build and run by name. "
echo "Example: 'just run-container aurora' -> runs aurora without systemd "
echo "Example: 'just run bluefin-dx' -> runs bluefin-dx with systemd "
echo " "
echo "Helper scripts are in 'project_root/scripts'. "
echo " "
echo "Modify the 'devcontainer.json' in 'project_root/.devcontainer' to support "
echo "Running the devcontainer with podman or docker "
echo "Manually specify container manager with '$CONTAINER_MGR' enviornment variable "
echo " "
just --list
# Build Bluefin
bluefin: (build "bluefin" "base" "{{gts}}")
# Build Bluefin-DX
bluefin-dx: (build "bluefin" "dx" "{{gts}}")
# Build Bluefin Latest
bluefin-latest: (build "bluefin" "base" "{{latest}}")
# Build Bluefin-DX Latest
bluefin-dx-latest: (build "bluefin" "dx" "{{latest}}")
# Build Aurora
aurora: (build "aurora" "base" "{{latest}}")
# Builed Aurora-DX
aurora-dx: (build "aurora" "dx" "{{latest}}")
# Build Bluefin-ISO
bluefin-iso: (build-iso "bluefin" "base" "{{gts}}")
# Build Bluefin-DX-ISO
bluefin-dx-iso: (build-iso "bluefin" "dx" "{{gts}}")
# Build Bluefin Latest-ISO
bluefin-latest-iso: (build-iso "bluefin" "base" "{{latest}}")
# Build Bluefin-DX Latest-ISO
bluefin-dx-latest-iso: (build-iso "bluefin" "dx" "{{latest}}")
# Build Aurora-ISO
aurora-iso: (build-iso "aurora" "base" "{{latest}}")
# Builed Aurora-DX-ISO
aurora-dx-iso: (build-iso "aurora" "dx" "{{latest}}")