<commit_before>#!/bin/bash

VERSION=2.8.0
ARCH=debian-amd64

echo "Installing OmniDB dependencies..."
pip install pip --upgrade
pip install -r ~/OmniDB/requirements.txt --upgrade
pip install -r ~/OmniDB/OmniDB/deploy/requirements_for_deploy_app.txt --upgrade
echo "Done."

echo "Installing NodeJS modules..."
cd ~/OmniDB/omnidb_app
npm install --unsafe-perm
echo "Done."

echo "Installing electron-packager..."
npm install electron-packager -g
echo "Done."

cd ~/OmniDB/OmniDB

echo -n "Cleaning... "
rm -rf build
rm -rf dist
rm -rf deploy/packages
rm -rf ~/OmniDB/omnidb_app/omnidb-gui*
echo "Done."

echo -n "Switching to Release Mode..."
sed -i -e 's/DEV_MODE = True/DEV_MODE = False/g' OmniDB/custom_settings.py
echo "Done."

echo -n "Switching to Desktop Mode... "
sed -i -e 's/DESKTOP_MODE = False/DESKTOP_MODE = True/g' OmniDB/custom_settings.py
echo "Done."

echo "Generating server bundles... "
pyinstaller OmniDB-lin.spec
echo "Done."

echo -n "Organizing server bundles..."
rm -rf build
mkdir deploy/packages
cp dist/omnidb-config/omnidb-config dist/omnidb-server/omnidb-config-server
chmod 777 dist/omnidb-server/OmniDB_app/static/temp/
rm -rf ~/OmniDB/omnidb_app/omnidb-server
mv dist/omnidb-server ~/OmniDB/omnidb_app
rm -rf dist
echo "Done."

echo "Generating GUI bundles..."
cd ~/OmniDB/omnidb_app
./buildgui.sh
cd omnidb-app-linux-x64
rm LICENSE* version
echo "Done."

echo -n "Organizing GUI bundles..."
cd ~/OmniDB/OmniDB
mv ~/OmniDB/omnidb_app/omnidb-app-linux-x64/* deploy/packages/omnidb-app
echo "Done."

echo -n "Renaming bundles... "
mv deploy/packages/omnidb-app deploy/packages/omnidb-app_$VERSION-$ARCH
echo "Done."

echo "Generating tar.gz packages... "
cd deploy/packages
chown -R vagrant:vagrant omnidb-app_$VERSION-$ARCH
tar -czvf omnidb-app_$VERSION-$ARCH.tar.gz omnidb-app_$VERSION-$ARCH
echo "Done"

echo "Generating deb packages... "
mv omnidb-app_$VERSION-$ARCH omnidb-app
mkdir -p omnidb-app_$VERSION-$ARCH
cd omnidb-app_$VERSION-$ARCH
mkdir opt
mv ../omnidb-app opt/
mkdir -p usr/bin
cd usr/bin<commit_msg>Preparing test deployment<commit_after>#!/bin/bash

VERSION=2.8.0
ARCH=debian-amd64

echo "Installing OmniDB dependencies..."
pip install pip --upgrade
pip install -r ~/OmniDB/requirements.txt --upgrade
pip install -r ~/OmniDB/OmniDB/deploy/requirements_for_deploy_app.txt --upgrade
echo "Done."

echo "Installing NodeJS modules..."
cd ~/OmniDB/omnidb_app
npm install --unsafe-perm
echo "Done."

echo "Installing electron-packager..."
npm install electron-packager -g
echo "Done."

cd ~/OmniDB/OmniDB

echo -n "Cleaning... "
rm -rf build
rm -rf dist
rm -rf deploy/packages
rm -rf ~/OmniDB/omnidb_app/omnidb-gui*
echo "Done."

echo -n "Switching to Release Mode..."
sed -i -e 's/DEV_MODE = True/DEV_MODE = False/g' OmniDB/custom_settings.py
echo "Done."

echo -n "Switching to Desktop Mode... "
sed -i -e 's/DESKTOP_MODE = False/DESKTOP_MODE = True/g' OmniDB/custom_settings.py
echo "Done."

echo "Generating server bundles... "
pyinstaller OmniDB-lin.spec
echo "Done."

echo -n "Organizing server bundles..."
rm -rf build
mkdir deploy/packages
cp dist/omnidb-config/omnidb-config dist/omnidb-server/omnidb-config-server
chmod 777 dist/omnidb-server/OmniDB_app/static/temp/
rm -rf ~/OmniDB/omnidb_app/omnidb-server
mv dist/omnidb-server ~/OmniDB/omnidb_app
rm -rf dist
echo "Done."

echo "Generating GUI bundles..."
cd ~/OmniDB/omnidb_app
./buildgui.sh
cd omnidb-app-linux-x64
rm LICENSE* version
echo "Done."

echo -n "Organizing GUI bundles..."
cd ~/OmniDB/OmniDB
mv ~/OmniDB/omnidb_app/omnidb-app-linux-x64 deploy/packages/omnidb-app
echo "Done."

echo -n "Renaming bundles... "
mv deploy/packages/omnidb-app deploy/packages/omnidb-app_$VERSION-$ARCH
echo "Done."

echo "Generating tar.gz packages... "
cd deploy/packages
chown -R vagrant:vagrant omnidb-app_$VERSION-$ARCH
tar -czvf omnidb-app_$VERSION-$ARCH.tar.gz omnidb-app_$VERSION-$ARCH
echo "Done"

echo "Generating deb packages... "
mv omnidb-app_$VERSION-$ARCH omnidb-app
mkdir -p omnidb-app_$VERSION-$ARCH
cd omnidb-app_$VERSION-$ARCH
mkdir opt
mv ../omnidb-app opt/
mkdir -p usr/bin
cd usr/bin
{'fraction_non_alphanumeric': 0.13951219512195123, 'fraction_numerical': 0.005853658536585366, 'mean_word_length': 3.8937947494033414, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4318075', 'n_tokens_mistral': 1686, 'n_tokens_neox': 1600, 'n_words': 401}