Update install.sh

This commit is contained in:
Anduin Xue
2023-12-30 15:24:32 +00:00
parent 41a2053ce7
commit f966cc6fa4
+14 -2
View File
@@ -12,16 +12,28 @@ install()
port=$(aiur network/get_port)
fi
echo "Installing $app_name... to port $port"
# Install prerequisites
aiur install/dotnet
aiur install/node
# Clone the repo
aiur git/clone_to $repo_path /tmp/repo
npm install --prefix "/tmp/repo/src/Aiursoft.ChessServer/wwwroot/"
# Install node modules
wwwrootPath=$(dirname "/tmp/repo/$proj_path")/wwwroot
if [ -d "$wwwrootPath" ]; then
echo "Found wwwroot folder $wwwrootPath, will install node modules."
sudo npm install --prefix "$wwwrootPath" -force
fi
# Publish the app
aiur dotnet/publish "/tmp/repo/$proj_path" "/opt/apps/$app_name"
# Register the service
aiur services/register_aspnet_service $app_name $port "/opt/apps/$app_name" $dll_name
# Clean up
echo "Install $app_name finished! Please open http://$(hostname):$port to try!"
sudo rm /tmp/repo -rf
}