Skip to content
Snippets Groups Projects
Commit 362b5274 authored by Emanuele Aina's avatar Emanuele Aina Committed by Frédéric Dalleau
Browse files

ostree-prepare-local-repo: Split ostree repo creation out of Jenkinsfile


Move the shell commands to prepare the local ostree repository out of
the Jenkinsfile to a script for easier usage when building locally.

Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
parent af28d242
No related branches found
No related tags found
1 merge request!112Sysroot cleanup, plus some other tweaks
......@@ -227,21 +227,7 @@ def buildOStree(architecture, type, board, debosarguments = "", repo = "repo") {
sh(script: """
cd ${PIPELINE_VERSION}/${architecture}/${type}
rm -rf ${repo}
mkdir ${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
${WORKSPACE}/scripts/ostree-prepare-local-repo.sh ${repo} ${ostree_pull_url} ${branch}
""")
sh(script: """
......
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment