entrypoint script now upgrades

This commit is contained in:
Joeri de Bruin 2026-02-25 18:22:11 +01:00
parent e07af2eb65
commit c6e7012f56
2 changed files with 6 additions and 3 deletions

View file

@ -114,11 +114,14 @@ apachectl start
WebGUI includes Docker support for easy containerized deployment:
```bash
# Build Docker image
```bash
docker build -t webgui:latest .
```
# Run with docker-compose (see distribution/docker-compose.yml)
```bash
cd distribution
docker-compose up -d
```

View file

@ -18,12 +18,12 @@ for configfile in `perl -Ilib sbin/wgd for-each`;do
code_version=`perl -Ilib -e 'use WebGUI; print $WebGUI::VERSION;'`
echo "code version $code_version"
echo "database version $db_version for $configfile"
echo "database version $db_version for $configfile with configfile $configfile"
if [ "$db_version" != "$code_version" ];then
echo "Upgrading Webgui from $db_version to $code_version..."
#first we alter the userSession table to make sure that the userId has a default value This is required for the upgrade process to work correctly.
`mysql -e 'alter table userSession MODIFY COLUMN userId char(22) NOT NULL DEFAULT "0";' $connection_info ` && break
`mysql -e 'alter table userSession MODIFY COLUMN userId char(22) NOT NULL DEFAULT "0";' $connection_info `
perl -Ilib sbin/wgd reset --upgrade --verbose --config-file=$configfile --webgui-root=/data/WebGUI/