fix(staging): ensure wpp can write sqlite db during deploy
This commit is contained in:
@@ -17,6 +17,11 @@ rm -rf src && mkdir src
|
|||||||
tar -xzf app.tar.gz -C src --strip-components=1
|
tar -xzf app.tar.gz -C src --strip-components=1
|
||||||
rm -rf /opt/wpp-staging/app/*
|
rm -rf /opt/wpp-staging/app/*
|
||||||
cp -a src/. /opt/wpp-staging/app/
|
cp -a src/. /opt/wpp-staging/app/
|
||||||
|
# Ensure deploy artifact copied as root does not leave SQLite/app tree non-writable for wpp.
|
||||||
|
chown -R wpp:wpp /opt/wpp-staging/app
|
||||||
|
if [ -f /opt/wpp-staging/app/db.sqlite3 ]; then
|
||||||
|
chmod 664 /opt/wpp-staging/app/db.sqlite3
|
||||||
|
fi
|
||||||
cd /opt/wpp-staging/app
|
cd /opt/wpp-staging/app
|
||||||
runuser -u wpp -- python3 -m venv .venv
|
runuser -u wpp -- python3 -m venv .venv
|
||||||
runuser -u wpp -- .venv/bin/pip install -U pip >/dev/null
|
runuser -u wpp -- .venv/bin/pip install -U pip >/dev/null
|
||||||
|
|||||||
Reference in New Issue
Block a user