more updates

This commit is contained in:
2025-07-30 21:57:31 -04:00
parent 93954f3190
commit 5d71c964b7
4 changed files with 46 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
#!/bin/bash
cd $DEPLOYMENT_DIR
cd $DOMAIN_DIR
# Create our service configuration
service_file=$DOMAIN.service
@@ -10,17 +10,31 @@ After=network.target
[Service]
Type=simple
ExecStart=make start
ExecStart='PORT=$PORT make start'
User=drm
WorkingDirectory=$DEPLOYMENT_DIR/src
WorkingDirectory=$DOMAIN_DIR/src
Restart=on-failure
StandardOutput=file:$DEPLOYMENT_DIR/start.log
StandardError=file:$DEPLOYMENT_DIR/start.log
StandardOutput=file:$LOGS_DIR/start.log
StandardError=file:$LOGS_DIR/start.log
[Install]
WantedBy=multi-user.target
" > $service_file
echo "
SHELL := /bin/bash
status:
systemctl status deployer-$DOMAIN
logs:
journalctl -u deployer-$DOMAIN
stop
systemctl stop deployer-$DOMAIN
" > Makefile
# create a folder to put the source code
mkdir -p src
@@ -41,7 +55,7 @@ make build
cd ..
service="deployer-$DOMAIN.service"
ln -sf $DEPLOYMENT_DIR/$service_file /etc/systemd/system/$service
ln -sf $DOMAIN_DIR/$service_file /etc/systemd/system/$service
systemctl daemon-reload
systemctl restart $service