summaryrefslogtreecommitdiffstats
path: root/venv-trog.sh
blob: 5294646077310719ad673f45bede0d6c5c09cf2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# now using uv, unbelieveably simpler.
# Run this in a terminal in ~/expo above the troggle directory: 'bash ~/expo/venv-trog.sh'
echo '-- Run this in a terminal in the directory above the troggle directory: "bash ~/expo/venv-trog.sh"'

# Expects an Ubuntu 24.04 with all the gubbins already installed
# If you have not already installed these on your clean Ubuntu install DO THIS FIRST
# use the script os-trog24.04.sh runniing it in /home/username/
python3 --version
cd ~/expo/troggle
echo "-- EXPO    folder [current directory]:    `pwd`"
TROGDIR=$(cd $(dirname $0) && pwd)
echo "-- Troggle folder: ${TROGDIR}"

cp dev.toml pyproject.toml
cp ~/expo/troggle/_deploy/wsl/localsettingsWSL.py ~/expo/troggle/localsettings.py

uv self update
uv sync


# fudge for philip's laptop prior to M2 SSD upgrade
if [ ! -d /mnt/d/EXPO ]; then
  sudo mkdir /mnt/d
  sudo mount -t drvfs D: /mnt/d
fi
  
uv pip list

echo "Django version:`uv run django-admin --version`"

echo "### Now do 
  '[sudo service mysql start]'
  '[sudo service mariadb restart]'
  '[sudo mysql_secure_installation]'
  'cd ~/expo/troggle'
  'uv run django-admin'
  'uv run manage.py check'
## this tests if you have set up ssh correcting. Refer to documentation https://expo.survex.com/handbook/computing/keyexchange.html
## you need to follow the Linux instructions.
  'ssh expo@expo.survex.com'

## the next tests will fail unless ~/expofiles is set correctly to a folder on your machine

   'uv run  manage.py test -v 2'
   './pre-run.sh' (runs the tests again)
   
   'uv run  databaseReset.py reset INIT'
   'uv run  manage.py runserver 0.0.0.0:8000 (and allow access when the firewall window pops up)'
   "
# if [ ! -d /mnt/d/expofiles ]; then
  # echo '### No valid expofiles directory on /mnt/d . Fix this before any tests will work.'
# fi