From 92021834b6bf0d506285a7cf3f0b006629e4e0a2 Mon Sep 17 00:00:00 2001 From: Michael Green <84688932+michael-j-green@users.noreply.github.com> Date: Thu, 25 Jan 2024 11:23:44 +1100 Subject: [PATCH] Created Build and deploy from source (markdown) --- Build-and-deploy-from-source.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Build-and-deploy-from-source.md diff --git a/Build-and-deploy-from-source.md b/Build-and-deploy-from-source.md new file mode 100644 index 0000000..efc3a25 --- /dev/null +++ b/Build-and-deploy-from-source.md @@ -0,0 +1,21 @@ +1. Install and configure a MariaDB or MySQL instance - this is beyond the scope of this document +2. Install the dotnet 7.0 packages appropriate for your operating system + * See: https://learn.microsoft.com/en-us/dotnet/core/install/linux +3. Create a database user with permission to create a databse. Gaseous will create the new database and apply the database schema on it's first startup. +4. Clone the repo with ```git clone https://github.com/gaseous-project/gaseous-server.git``` +5. Change into the gaseous-server directory +6. As the main branch is the development branch, you might want to change to a stable version - these are tagged with a version number. For example to change to the 1.5.0 release, use the command ```git checkout v1.5.0``` + * Check the releases page for the version you would like to run: https://github.com/gaseous-project/gaseous-server/releases +7. Download the emulator files from ```https://cdn.emulatorjs.org/releases/4.0.9.zip``` and extract the files to ```gaseous-server/wwwroot/emulators/EmulatorJS``` +8. Create a directory in the home directory of the user that will run the server. For example, if running as the user ```gaseous```, create the directory ```/home/gaseous/.gaseous-server``` +9. Change into the ```.gaseous-server``` directory created in the previous step +10. Copy the JSON from the config file above into a new file named ```config.json``` +11. Update the database section with the database server hostname, username, password, and port +12. Compile the server by changing back to the repo cloned earlier and executing: + * ```dotnet restore "gaseous-server/gaseous-server.csproj"``` + * ```dotnet publish "gaseous-server/gaseous-server.csproj" --use-current-runtime --self-contained false -c Release -o ``` + * replace `````` with the directory of your choosing. The compiled application will be copied there. For this example we'll use ```/opt/gaseous-server``` +13. The server can then be started by executing ```dotnet /opt/gaseous-server/gaseous-server.dll``` + * If you would like the server to run on a different ip address and port (for example 0.0.0.0:8080), add the --urls argument: ```dotnet /opt/gaseous-server/gaseous-server.dll --urls http://0.0.0.0:8080``` + +**Note**: The above instructions were tested on macOS Ventura, and Ubuntu 22.04.3. There was a report that Debian 11 had an issue with the git submodule commands (see: https://github.com/gaseous-project/gaseous-server/issues/71). This was possibly due to an older git package. \ No newline at end of file