修改部署脚本
This commit is contained in:
parent
3b97f073d2
commit
081e2656f5
@ -50,6 +50,17 @@ if ! ls python3*.rpm >/dev/null 2>&1; then
|
||||
fi
|
||||
rpm -Uvh --nodeps python3*.rpm
|
||||
|
||||
# Install Python packages using yum
|
||||
log_info "Installing Python packages..."
|
||||
yum install -y python3-flask python3-werkzeug python3-jinja2 python3-markupsafe
|
||||
|
||||
# Verify Python packages
|
||||
log_info "Verifying Python packages..."
|
||||
python3 -c "import flask; import werkzeug; import jinja2; import markupsafe" || {
|
||||
log_error "Failed to verify Python packages"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Create work directory
|
||||
WORK_DIR="/opt/collision_avoidance"
|
||||
log_info "Creating work directory: $WORK_DIR"
|
||||
@ -119,13 +130,6 @@ if ! cp -v "${PROJECT_ROOT}/lib/"* "$WORK_DIR/lib/"; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Copy Python packages
|
||||
log_info "Copying Python packages..."
|
||||
if ! cp -v "${PROJECT_ROOT}/python/"* "/tmp/"; then
|
||||
log_error "Failed to copy Python packages"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Copy tools
|
||||
log_info "Copying tools..."
|
||||
if ! cp -v "${PROJECT_ROOT}/tools/"* "$WORK_DIR/tools/"; then
|
||||
@ -161,15 +165,6 @@ if ! ls -l "$CONFIG_DIR"/*.json; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Install Python packages
|
||||
log_info "Installing Python packages..."
|
||||
cd /tmp
|
||||
for pkg in *.whl; do
|
||||
if [ -f "$pkg" ]; then
|
||||
pip3 install --no-index "$pkg"
|
||||
fi
|
||||
done
|
||||
|
||||
# Create service file
|
||||
log_info "Creating system service..."
|
||||
cat > /etc/systemd/system/collision-avoidance.service << EOL
|
||||
|
||||
Loading…
Reference in New Issue
Block a user