From 3967ee3304e310f63e0f9e05a1671c3b6d9418d9 Mon Sep 17 00:00:00 2001 From: m3mo Date: Mon, 21 Apr 2025 02:22:13 +0200 Subject: [PATCH] Update deployment script to use root directory --- deploy.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/deploy.sh b/deploy.sh index d387d1d..5aa4481 100755 --- a/deploy.sh +++ b/deploy.sh @@ -10,12 +10,12 @@ echo -e "${BLUE}=== Setting up Postaci on Ubuntu Server ===${NC}" # Update system echo -e "${YELLOW}Updating system packages...${NC}" -sudo apt update && sudo apt upgrade -y +apt update && apt upgrade -y # Install Node.js, npm, and other dependencies echo -e "${YELLOW}Installing Node.js and dependencies...${NC}" -curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - -sudo apt install -y nodejs postgresql postgresql-contrib nginx git +curl -fsSL https://deb.nodesource.com/setup_18.x | bash - +apt install -y nodejs postgresql postgresql-contrib nginx git # Check Node.js and npm versions echo -e "${GREEN}Installed Node.js version:${NC}" @@ -25,8 +25,8 @@ npm -v # Start and enable PostgreSQL echo -e "${YELLOW}Setting up PostgreSQL...${NC}" -sudo systemctl start postgresql -sudo systemctl enable postgresql +systemctl start postgresql +systemctl enable postgresql # Create PostgreSQL user and database echo -e "${YELLOW}Creating PostgreSQL user and database...${NC}" @@ -36,11 +36,11 @@ sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE postaci TO postaci;" # Clone the repository echo -e "${YELLOW}Cloning repository...${NC}" -git clone https://gitea.oezdag.io/m3mo/POSTERAPP_V1.git /home/ubuntu/postaci +git clone https://gitea.oezdag.io/m3mo/POSTERAPP_V1.git /root/postaci # Set up the application echo -e "${YELLOW}Setting up the application...${NC}" -cd /home/ubuntu/postaci +cd /root/postaci # Install dependencies echo -e "${YELLOW}Installing npm dependencies...${NC}" @@ -79,8 +79,8 @@ After=network.target [Service] Type=simple -User=ubuntu -WorkingDirectory=/home/ubuntu/postaci/validation-service +User=root +WorkingDirectory=/root/postaci/validation-service ExecStart=/usr/bin/node server.js Restart=on-failure Environment=NODE_ENV=production @@ -98,8 +98,8 @@ After=network.target [Service] Type=simple -User=ubuntu -WorkingDirectory=/home/ubuntu/postaci +User=root +WorkingDirectory=/root/postaci ExecStart=/usr/bin/npm start Restart=on-failure Environment=NODE_ENV=production