Skip to content
Snippets Groups Projects

Add example recipes to build a single image

Merged Frederic Danis requested to merge fdanis/apertis-image-recipes:T5675 into apertis/v2019dev0
1 unresolved thread
2 files
+ 30
15
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 29
0
#!/bin/sh
set -eu
if [ $# -ne 3 ]
then
echo "Usage: $0 REPO PULL_URL BRANCH" >&2
exit 1
fi
repo=$1
ostree_pull_url=$2
branch=$3
mkdir -p "${repo}"
ostree init --repo="${repo}" --mode archive-z2
ostree remote --repo="${repo}" add --no-gpg-verify origin "${ostree_pull_url}"
http_code=$(curl --location --silent -o /dev/null --head -w "%{http_code}" "${ostree_pull_url}/refs/heads/${branch}")
case "$http_code" in
200)
ostree pull --repo="${repo}" --depth=-1 --mirror --disable-fsync origin "${branch}"
;;
404)
;;
*)
echo "Error: Got HTTP '$http_code' trying to fetch '${ostree_pull_url}/refs/heads/${branch}'"
exit 1
;;
esac
Loading