Skip to content

Commit bb5ff2d

Browse files
committed
Add service installation step and fix file permissions in deployment script
1 parent 04ccc0a commit bb5ff2d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

bin/deploy-with-migrations.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,13 @@ echo -e "${YELLOW}Running deployment script...${NC}"
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"
38+
3539
# Run migrations on the remote server
36-
echo -e "${YELLOW}Running database migrations on remote server...${NC}"
37-
ssh $SSH_OPTS $REMOTE_USER@$REMOTE_HOST "cd $REMOTE_DIR && ./bin/supabase-db.sh migrate"
40+
echo -e "${YELLOW}Running migrations on remote server...${NC}"
41+
ssh $SSH_OPTS $REMOTE_USER@$REMOTE_HOST "cd $REMOTE_DIR && chmod +x ./bin/supabase-db.sh && ./bin/supabase-db.sh migrate"
3842

3943
if [ $? -eq 0 ]; then
4044
echo -e "${GREEN}Migrations successful!${NC}"
@@ -45,7 +49,7 @@ else
4549
exit 1
4650
fi
4751

48-
# Restart the service
52+
# The service is already started by install-service.sh, but we'll restart it to be sure
4953
echo -e "${YELLOW}Restarting service...${NC}"
5054
ssh $SSH_OPTS $REMOTE_USER@$REMOTE_HOST "sudo systemctl restart profullstack-pdf.service"
5155

0 commit comments

Comments
 (0)