Skip to content

Commit

Permalink
Adding functions for refreshing Vectara Ingest.
Browse files Browse the repository at this point in the history
  • Loading branch information
shefulloflight committed Jan 21, 2025
1 parent 007f0ed commit caf3dc8
Showing 1 changed file with 59 additions and 13 deletions.
72 changes: 59 additions & 13 deletions docs-menu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,50 @@ check_secrets_toml() {
fi
}

# Check that the Qumulo configuration files exist
check_qumulo_config_files(){
if ! ls ~/git/vectara-ingest/config/qumulo-*.yaml >/dev/null 2>&1; then
echo "To ingest data into Vectara, you must add qumulo-*.yaml files to the config/ subdirectory"
echo "of your Vectara Ingest directory."
echo
echo "Exiting..."
exit 1
fi
}

# Refresh Vectara Ingest repo
refresh_vectara_ingest_repo() {
echo "Refreshing the Vectara Ingest repository requires synchronizing our fork."
echo "This removes all modifications from the repository. Continue? (y/n)"
read -r answer
if [ "$answer" = "y" ]; then
check_vectara_ingest_repo

check_qumulo_config_files
cp ../backup/qumulo-documentation-portal.yaml config/
cp ../backup/qumulo-care.yaml config/
cp ../backup/qumulo-main.yaml config/

check_secrets_toml
cp ../backup/secrets.toml .

echo "Pulling down latest updates... This process overwrites all local configuration files."
cd ~/git/vectara-ingest
git reset --hard upstream/main
git push origin main --force

echo "Preparing repository..."
chmod +x run.sh

echo "Committing changes..."
git add --all && git commit -m "Added configuration files" && git push
elif [ "$answer" = "n" ]; then
echo
echo "Exiting..."
exit 1
fi
}

# Install Docker and explain group changes
install_docker() {
if ! command -v docker &> /dev/null; then
Expand Down Expand Up @@ -231,7 +275,7 @@ ingest_docs_portal() {
no_toolchain
check_vectara_ingest_repo
check_secrets_toml
ingest_documentation "qumulo-documentation-portal-v3.yaml"
ingest_documentation "qumulo-documentation-portal.yaml"
}

# Ingest care.qumulo.com into Vectara corpus 4
Expand All @@ -240,7 +284,7 @@ ingest_care_portal() {
no_toolchain
check_vectara_ingest_repo
check_secrets_toml
ingest_documentation "qumulo-care-v4.yaml"
ingest_documentation "qumulo-care.yaml"
}

# Ingest qumulo.com into Vectara corpus 5
Expand All @@ -249,7 +293,7 @@ ingest_corp_site() {
no_toolchain
check_vectara_ingest_repo
check_secrets_toml
ingest_documentation "qumulo-main-v3.yaml"
ingest_documentation "qumulo-main.yaml"
}

# Check ingestion status
Expand Down Expand Up @@ -314,11 +358,12 @@ while true; do
echo "11. 📋 Check documentation for spelling errors"
echo "12. 🧹 Sweep Toolchain"
echo "13. 🧹 Prune Docker"
echo "14. 🔍 Ingest docs.qumulo.com into Vectara"
echo "15. 🔍 Ingest care.qumulo.com into Vectara"
echo "16. 🔍 Ingest qumulo.com into Vectara"
echo "17. 📋 Check ingestion status"
echo "18. ❌ Find unused .js scripts"
echo "14. 🧹 Refresh Vectara Ingest repo"
echo "15. 🔍 Ingest docs.qumulo.com into Vectara"
echo "16. 🔍 Ingest care.qumulo.com into Vectara"
echo "17. 🔍 Ingest qumulo.com into Vectara"
echo "18. 📋 Check ingestion status"
echo "19. ❌ Find unused .js scripts"
echo "q. 👋 Quit"
echo
read -p $'\033[1;33mWhat would you like to do? \033[0m' choice
Expand All @@ -337,11 +382,12 @@ while true; do
11) echo -e "⚠️ \033[1;31mThe spellcheker is disabled temporarily.\033[0m" ;;
12) sweep_toolchain ;;
13) prune_docker ;;
14) ingest_docs_portal ;;
15) ingest_care_portal ;;
16) ingest_corp_site ;;
17) check_ingestion_status ;;
18) find_unused_scripts ;;
14) refresh_vectara_ingest_repo;;
15) ingest_docs_portal ;;
16) ingest_care_portal ;;
17) ingest_corp_site ;;
18) check_ingestion_status ;;
19) find_unused_scripts ;;
q) exit ;;
*) echo "You must enter a valid option." ;;
esac
Expand Down

0 comments on commit caf3dc8

Please sign in to comment.