feat: Add deploy system
This commit is contained in:
40
install_modules.sh
Executable file
40
install_modules.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -e # Exit on error
|
||||
|
||||
echo "Files in /app directory:"
|
||||
ls -la /app/
|
||||
|
||||
if [ -d "/app/modules" ] && [ "$(ls -A /app/modules)" ]; then
|
||||
module_names=()
|
||||
for module in /app/modules/*/; do
|
||||
echo "Processing module: $module"
|
||||
|
||||
pushd "$module" > /dev/null
|
||||
|
||||
# Install dependencies
|
||||
pip3 install . --break-system-packages
|
||||
|
||||
# Extract module name
|
||||
trytond_modules_path=$(pip3 show trytond | grep Location | sed -nr 's/Location: +//gp')/trytond/modules
|
||||
module_name=$(cat "setup.py" | grep -A 1 "\[trytond.modules\]" | sed 1d | cut -d '=' -f 1 | tr -d ' \n')
|
||||
|
||||
# Add to array
|
||||
module_names+=("$module_name")
|
||||
|
||||
# Validate path
|
||||
if [ ! -d "$trytond_modules_path" ]; then
|
||||
echo "ERROR: Failed to locate trytond modules path" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create symlink (fix: use direct path, not $SRC)
|
||||
ln -sf "$module" "$trytond_modules_path/$module_name"
|
||||
|
||||
popd > /dev/null
|
||||
done
|
||||
|
||||
# Create colon-separated list
|
||||
module_names=$(IFS=:; echo "${module_names[*]}")
|
||||
echo "Installed modules: $module_names"
|
||||
fi
|
||||
Reference in New Issue
Block a user