summaryrefslogtreecommitdiff
path: root/commit-os
blob: 3648285728ed5e2ec40fe3e56fc35ef2e2a7b5ea (plain)
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
#!/bin/bash -xe
set -o pipefail

. config
. sh-lib

# Check for dependencies:
package_deps ostree

#TODO: Maybe this script should take branch and version as arguments?
version="$(cd "${roots:?}"/"${branch:?}"; find ./ -mindepth 1 -maxdepth 1 -type d | cut -d/ -f2 | sort -rn | head -1)"
root="${roots:?}"/"${branch:?}"/"$version"

if [ ! -d "$root" ]; then
	echo "Error: root dir not found: $root" >&2
	exit 1
fi

[ -d "$build_repo" ] && rm -rf "$build_repo"

mkdir -p "$build_repo"

ostree --repo="$build_repo" init --mode=archive

ostree --repo="$build_repo" commit -b "$branch" --tree=dir="$root"