Files
landing_page/automation/doc-sync.sh
T
trean 0dfc50ee05 Synchronization of documentation
added an automated synchronization of documentation; includes git action and bash script
2022-03-09 11:04:03 +01:00

27 lines
680 B
Bash

#!/bin/bash
set -e
DOC_REP=docs
git clone https://github.com/qdrant/$DOC_REP.git
if [ -d $DOC_REP ]; then
DOC_VERSION=$(grep -o 'docVersion = .*' ./qdrant-landing/config.toml | awk -F'"' '/(docVersion = )"([^"]+)"/{ print $2 }')
fi;
DOC_DESTINATION=./qdrant-landing/content/documentation
DOC_SOURCE=./docs/qdrant/$DOC_VERSION
DIFFER=$(diff -qr qdrant-landing/content/documentation docs/qdrant/"$DOC_VERSION" | cat);
#if there is no changes, script just exits with code 0
if [ -z "$DIFFER" ]; then
echo "Sync is not needed, files are identical"
rm -rf ./$DOC_REP
exit 0;
fi;
#updates docs
rm -rf $DOC_DESTINATION
mv "$DOC_SOURCE" "$DOC_DESTINATION"
rm -rf ./$DOC_REP