fix: typo in setup.sh
This commit is contained in:
parent
501395c36e
commit
00fdfb70f6
1 changed files with 42 additions and 1 deletions
43
setup.sh
43
setup.sh
|
|
@ -5,7 +5,7 @@ set -eo pipefail
|
||||||
# running in guest
|
# running in guest
|
||||||
|
|
||||||
guest_name="$(qubesdb-read /name)"
|
guest_name="$(qubesdb-read /name)"
|
||||||
#guest_repo_dir="$(realpath ""$@"")"
|
|
||||||
guest_repo_dir="$(dirname $(realpath ""$0""))"
|
guest_repo_dir="$(dirname $(realpath ""$0""))"
|
||||||
echo $guest_repo_dir
|
echo $guest_repo_dir
|
||||||
pushd ${guest_repo_dir} >/dev/null
|
pushd ${guest_repo_dir} >/dev/null
|
||||||
|
|
@ -24,3 +24,44 @@ git bundle create .bundles/domu.bundle "${branch}"
|
||||||
|
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
|
|
||||||
|
# piped to bash in dom0
|
||||||
|
|
||||||
|
cat <<-DOM0
|
||||||
|
set -eo pipefail
|
||||||
|
|
||||||
|
echo "(dom0) bringing bundle from qubes '${guest_name}'" >&2
|
||||||
|
|
||||||
|
qvm-run -p ${guest_name} "cat ${guest_repo_dir}/.bundles/domu.bundle" </dev/null >/tmp/saltstuff.bundle
|
||||||
|
|
||||||
|
echo "{dom0} cloning into \$1; checking out branch '${branch}'" >&2
|
||||||
|
|
||||||
|
git clone /tmp/saltstuff.bundle -b "${branch}" "\$1"
|
||||||
|
|
||||||
|
pushd "\$1"
|
||||||
|
|
||||||
|
echo "{dom0} setting up remote '${guest_name}' to push/pull changes via bundle" >&2
|
||||||
|
|
||||||
|
mkdir .bundles
|
||||||
|
mv /tmp/saltstuff.bundle .bundles/domu.bundle
|
||||||
|
git remote remove origin
|
||||||
|
git remote add "${guest_name}" \${pwd}/.bundles/domu.bundle
|
||||||
|
|
||||||
|
# ensure remote refs are present in each repo
|
||||||
|
git fetch "${guest_name}" # ensure remote refs are present in the dom0 repo
|
||||||
|
|
||||||
|
git bundle create .bundles/dom0.bundle main~1..main main
|
||||||
|
|
||||||
|
qvm-run -p "${guest_name}" "cat > ${guest_repo_dir}/.bundles/dom0.bundle" <.bundles/dom0.bundle
|
||||||
|
|
||||||
|
qvm-run -p "${guest_name}" "cd ${guest_repo_dir} && git fetch dom0" </dev/null
|
||||||
|
|
||||||
|
# configure pointer to guest VM and path
|
||||||
|
|
||||||
|
echo "GUEST=${guest_name}" > .bundle-env
|
||||||
|
echo "GUEST_REPO=${guest_repo_dir}" >> .bundle-env
|
||||||
|
|
||||||
|
echo "${dom0} has pulled!" >&2
|
||||||
|
|
||||||
|
popd
|
||||||
|
DOM0
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue