2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-02-08 10:10:59 +00:00

Fixing new dev machine setup

This commit is contained in:
Philip Sargent (laptop)
2023-05-02 14:27:55 +03:00
parent 783154d24a
commit 8e982bd6be
10 changed files with 277 additions and 23 deletions

View File

@@ -3,17 +3,16 @@
# Run this in a terminal in the troggle directory: 'bash venv-trog.sh'
echo '-- Run this in a terminal in the real troggle directory: "bash venv-trog.sh"'
# Expects an Ubuntu 22.04 relatively clean install.
# Expects an Ubuntu 22.04 (or 20.04) relatively clean install.
# If you have not already installed these on your clean Ubuntu install DO THIS FIRST
# use the script os-trog.sh
# If you are using Debian, then stick with the default version of python
# If you are using Ubuntu, then it is easy to use a later version of python, e.g. 3.11
# NOW we set up troggle
PYTHON=python3.11
VENAME=p11d3 # python3.x and django 3.2
VENAME=p11d4 # python3.x and django 4.2
echo "** You are logged in as `id -u -n`"
echo "The 50MB pip cache will be in /home/`id -u -n`/.cache/"
echo "The 150MB venv will created in /home/`id -u -n`/$VENAME/"
@@ -21,14 +20,13 @@ TROGDIR=$(cd $(dirname $0) && pwd)
echo "-- Troggle folder (this script location): ${TROGDIR}"
if [ -d requirements.txt ]; then
echo "-- No requirements.txt found. Copy it from your most recent installation."
echo "-- No requirements.txt found. You should be in the /troggle/ folder. Copy it from your most recent installation."
exit 1
fi
echo ## Using requirements.txt :
cat requirements.txt
echo ##
$PYTHON --version
# NOTE that when using a later or earlier verison of python, you MUST also
@@ -79,17 +77,17 @@ ln -s ${TROGDIR}/../drawings drawings
if [ -d ${TROGDIR}/../expofiles ]; then
ln -s ${TROGDIR}/../expofiles expofiles
else
if [ ! -d /mnt/f/expofiles ]; then
sudo mkdir /mnt/f
sudo mount -t drvfs F: /mnt/f
if [ ! -d /mnt/d/expofiles ]; then
sudo mkdir /mnt/d
sudo mount -t drvfs D: /mnt/d
else
ln -s /mnt/f/expofiles expofiles
ln -s /mnt/d/expofiles expofiles
fi
fi
echo "### Setting file permissions.. may take a while.."
git config --global --add safe.directory '*'
sudo chmod -r 0777 *
sudo chmod -R 777 *
echo "### links to expoweb, troggle etc. complete:"
ls -tla
@@ -154,8 +152,7 @@ echo "### Now do
## the next tests will fail unless ~/expofiles is set correctly to a folder on your machine
## the tests may ALSO fail because of ssh and permissions errors
# Ran 85 tests in 83.492s
# FAILED (failures=5)
## So you will need to run
$sudo chown -Rhv philip:philip ~/$VENAME (if your username is philip)
# and then REBOOT (or at least, exit WSL and terminate and restart WSL)
@@ -167,6 +164,6 @@ $sudo chown -Rhv philip:philip ~/$VENAME (if your username is philip)
'python databaseReset.py reset $VENAME'
'python manage.py runserver 0.0.0.0:8000 (and allow access when the firewall window pops up)'
"
if [ ! -d /mnt/f/expofiles ]; then
echo '### No valid expofiles directory. Fix this before any tests will work.
if [ ! -d /mnt/d/expofiles ]; then
echo '### No valid expofiles directory on /mnt/d . Fix this before any tests will work.
fi