Skip to content

Commit 0d3fb45

Browse files
committed
Update project ID and improve deployment script service installation logic
1 parent 8618506 commit 0d3fb45

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

bin/deploy-with-migrations.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,21 @@ REMOTE_DIR="${DEPLOY_REMOTE_DIR:-www/profullstack.com/pdf}"
2626
# Create SSH options
2727
SSH_OPTS="-p $REMOTE_PORT"
2828

29-
# Deploy the code first
29+
# Deploy the code first using deploy.sh
3030
echo -e "${YELLOW}Running deployment script...${NC}"
3131
./bin/deploy.sh
3232

3333
echo -e "${GREEN}Deployment successful!${NC}"
3434

35-
# Run install-service.sh on the remote server to install dependencies and set up the service
36-
echo -e "${YELLOW}Installing service and dependencies on remote server...${NC}"
37-
ssh $SSH_OPTS $REMOTE_USER@$REMOTE_HOST "cd $REMOTE_DIR && chmod +x ./bin/install-service.sh && sudo ./bin/install-service.sh"
35+
# Check if INSTALL_SERVICE was set to true in the .env file
36+
# If it was, the service was already installed by deploy.sh
37+
if [ "$INSTALL_SERVICE" != "true" ]; then
38+
# Run install-service.sh on the remote server to install dependencies and set up the service
39+
echo -e "${YELLOW}Installing service and dependencies on remote server...${NC}"
40+
ssh $SSH_OPTS $REMOTE_USER@$REMOTE_HOST "cd $REMOTE_DIR && chmod +x ./bin/install-service.sh && sudo ./bin/install-service.sh"
41+
else
42+
echo -e "${YELLOW}Skipping service installation as it was already done by deploy.sh...${NC}"
43+
fi
3844

3945
# Run Supabase setup and migrations on the remote server
4046
echo -e "${YELLOW}Running Supabase setup and migrations on remote server...${NC}"
@@ -61,7 +67,7 @@ else
6167
exit 1
6268
fi
6369

64-
# The service is already started by install-service.sh, but we'll restart it to be sure
70+
# Restart the service after all operations are complete
6571
echo -e "${YELLOW}Restarting service...${NC}"
6672
ssh $SSH_OPTS $REMOTE_USER@$REMOTE_HOST "sudo systemctl restart profullstack-pdf.service"
6773

bin/deploy.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ if ssh $SSH_OPTS $REMOTE_USER@$REMOTE_HOST "[ -d $REMOTE_DIR ]"; then
9090
echo -e " cd $REMOTE_DIR && sudo ./bin/install-service.sh"
9191
fi
9292

93-
# Always reload systemd daemon after deployment
93+
# We don't restart services here - that's handled by deploy-with-migrations.sh
94+
# Just reload the systemd daemon
9495
echo -e "${YELLOW}Reloading systemd daemon on remote host...${NC}"
9596
ssh $SSH_OPTS $REMOTE_USER@$REMOTE_HOST "sudo systemctl daemon-reload"
9697
else

supabase/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# A string used to distinguish different Supabase projects on the same host. Defaults to the working
22
# directory name when running `supabase init`.
3-
project_id = "profullstack-pdf"
3+
project_id = "arokhsfbkdnfuklmqajh"
44

55
[api]
66
# Port to use for the API URL.

0 commit comments

Comments
 (0)