修改部署脚本
This commit is contained in:
parent
0100107314
commit
6eddb1e78f
@ -31,8 +31,17 @@ PROJECT_ROOT="$(dirname "${SCRIPT_DIR}")"
|
||||
|
||||
# Install RPM packages
|
||||
log_info "Installing RPM packages..."
|
||||
cd "${PROJECT_ROOT}/deploy/rpm"
|
||||
if [ ! -d "${PROJECT_ROOT}/rpm" ]; then
|
||||
log_error "RPM directory not found: ${PROJECT_ROOT}/rpm"
|
||||
exit 1
|
||||
fi
|
||||
cd "${PROJECT_ROOT}/rpm"
|
||||
|
||||
# Install Python3 and its dependencies
|
||||
if ! ls python3*.rpm >/dev/null 2>&1; then
|
||||
log_error "Python3 RPM packages not found"
|
||||
exit 1
|
||||
fi
|
||||
rpm -Uvh --nodeps python3*.rpm
|
||||
|
||||
# Create work directory
|
||||
@ -43,16 +52,22 @@ mkdir -p $WORK_DIR/tools
|
||||
|
||||
# Copy files
|
||||
log_info "Copying files..."
|
||||
cp -r "${PROJECT_ROOT}/deploy/bin/"* "/usr/local/bin/"
|
||||
cp -r "${PROJECT_ROOT}/deploy/lib/"* "/usr/lib64/"
|
||||
cp -r "${PROJECT_ROOT}/deploy/python/"* "/tmp/"
|
||||
cp -r "${PROJECT_ROOT}/deploy/tools/"* "$WORK_DIR/tools/"
|
||||
for dir in bin lib python tools config; do
|
||||
if [ ! -d "${PROJECT_ROOT}/${dir}" ]; then
|
||||
log_error "Directory not found: ${PROJECT_ROOT}/${dir}"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
cp -r "${PROJECT_ROOT}/bin/"* "/usr/local/bin/"
|
||||
cp -r "${PROJECT_ROOT}/lib/"* "/usr/lib64/"
|
||||
cp -r "${PROJECT_ROOT}/python/"* "/tmp/"
|
||||
cp -r "${PROJECT_ROOT}/tools/"* "$WORK_DIR/tools/"
|
||||
|
||||
# Create config directory
|
||||
CONFIG_DIR="/etc/collision_avoidance"
|
||||
log_info "Creating config directory: $CONFIG_DIR"
|
||||
mkdir -p $CONFIG_DIR
|
||||
cp -r "${PROJECT_ROOT}/deploy/config/"* "$CONFIG_DIR/"
|
||||
cp -r "${PROJECT_ROOT}/config/"* "$CONFIG_DIR/"
|
||||
|
||||
# Install Python packages
|
||||
log_info "Installing Python packages..."
|
||||
@ -87,6 +102,10 @@ EOL
|
||||
# Configure firewall
|
||||
log_info "Configuring firewall..."
|
||||
if command -v firewall-cmd &> /dev/null; then
|
||||
if ! systemctl is-active --quiet firewalld; then
|
||||
log_info "Starting firewalld service..."
|
||||
systemctl start firewalld
|
||||
fi
|
||||
firewall-cmd --permanent --add-port=8010/tcp
|
||||
firewall-cmd --permanent --add-port=8081/tcp
|
||||
firewall-cmd --reload
|
||||
|
||||
Loading…
Reference in New Issue
Block a user