-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·54 lines (42 loc) · 1.15 KB
/
build.sh
File metadata and controls
executable file
·54 lines (42 loc) · 1.15 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
#!/bin/bash
set -euxo pipefail
_ROOT_DIR="$(pwd)"
_TEMP_DIR="$(mktemp -d --tmpdir redpanda-livecd.XXXXXX)"
_SUDO=""
[[ $EUID -ne 0 ]] && _SUDO="sudo"
function fn-check-deps() {
_deps=("base-devel" "devtools" "archiso")
for dep in "${_deps[@]}"; do
if ! pacman -Q "$dep" &>/dev/null; then
echo "missing dependency: $dep"
exit 1
fi
done
mkdir -p "$_ROOT_DIR/repo" "$_ROOT_DIR/out"
}
function fn-build-pkg-redpanda-cpp {
cd "$_ROOT_DIR/packages/redpanda-cpp"
extra-x86_64-build
cp redpanda-cpp-*-x86_64.pkg.tar.zst "$_ROOT_DIR/repo"
}
function fn-create-repo {
cd "$_ROOT_DIR/repo"
repo-add redpanda.db.tar.gz $(ls *.pkg.tar.zst | sort --version-sort)
}
function fn-create-profile {
mkdir -p "$_TEMP_DIR/profile"
cp -r "$_ROOT_DIR"/profiles/minimal/* "$_TEMP_DIR/profile"
sed -i "s|__REDPANDA_LOCAL_REPO_PATH__|$_ROOT_DIR/repo|" "$_TEMP_DIR/profile/pacman.conf"
}
function fn-make-iso() {
$_SUDO mkarchiso -v -w "$_TEMP_DIR/work" -o "$_ROOT_DIR/out" "$_TEMP_DIR/profile"
}
function fn-clean() {
$_SUDO rm -rf "$_TEMP_DIR"
}
fn-check-deps
fn-build-pkg-redpanda-cpp
fn-create-repo
fn-create-profile
fn-make-iso
fn-clean