Unify update-docs.sh script with rpkg
Signed-off-by: Ondrej Nosek <onosek@redhat.com>
This commit is contained in:
parent
610bf4b125
commit
70f46dfb62
@ -3,26 +3,38 @@
|
|||||||
# Copyright (C) 2015 Red Hat, Inc.
|
# Copyright (C) 2015 Red Hat, Inc.
|
||||||
# SPDX-License-Identifier: GPL-2.0
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
|
|
||||||
set -e
|
trap cleanup EXIT
|
||||||
|
|
||||||
git clone https://pagure.io/pungi.git /tmp/pungi
|
function cleanup() {
|
||||||
pushd /tmp/pungi/doc
|
printf "Run cleanup\\n"
|
||||||
|
rm -rf "$dir_pungi" "$dir_pungi_doc"
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
printf "Usage:\\n"
|
||||||
|
printf "\\t%s release_version\\n" "$0"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
set -e
|
||||||
|
dir_pungi=$(mktemp -d /tmp/pungi.XXX) || { echo "Failed to create temp directory"; exit 1; }
|
||||||
|
git clone https://pagure.io/pungi.git "$dir_pungi"
|
||||||
|
pushd "$dir_pungi"/doc
|
||||||
make html
|
make html
|
||||||
popd
|
popd
|
||||||
|
|
||||||
git clone ssh://git@pagure.io/docs/pungi.git /tmp/pungi-doc
|
dir_pungi_doc=$(mktemp -d /tmp/pungi-doc.XXX) || { echo "Failed to create temp directory"; exit 1; }
|
||||||
pushd /tmp/pungi-doc
|
git clone ssh://git@pagure.io/docs/pungi.git "$dir_pungi_doc"
|
||||||
|
pushd "$dir_pungi_doc"
|
||||||
git rm -fr ./*
|
git rm -fr ./*
|
||||||
cp -r /tmp/pungi/doc/_build/html/* ./
|
cp -r "$dir_pungi"/doc/_build/html/* ./
|
||||||
pushd /tmp/pungi/doc
|
pushd "$dir_pungi"/doc
|
||||||
git checkout 4.0.x
|
git checkout 4.0.x
|
||||||
make html
|
make html
|
||||||
popd
|
popd
|
||||||
mkdir 4.0
|
mkdir 4.0
|
||||||
cp -r /tmp/pungi/doc/_build/html/* ./4.0/
|
cp -r "$dir_pungi"/doc/_build/html/* ./4.0/
|
||||||
git add .
|
git add .
|
||||||
git commit -s -m "update rendered pungi docs"
|
git commit -s -m "update rendered pungi docs for release $1"
|
||||||
git push origin master
|
git push origin master
|
||||||
popd
|
popd
|
||||||
|
|
||||||
rm -rf /tmp/pungi/ /tmp/pungi-doc/
|
|
||||||
|
Loading…
Reference in New Issue
Block a user