From 5dcfd2633bdf91df53e5fa051a767754300a5e8a Mon Sep 17 00:00:00 2001 From: Azareal Date: Tue, 24 Jul 2018 18:45:01 +1000 Subject: [PATCH] The systemd example service file should work now. --- gosora_example.service | 8 +++++--- pre-run-linux | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 pre-run-linux diff --git a/gosora_example.service b/gosora_example.service index 5fbd6624..1a6b4e47 100644 --- a/gosora_example.service +++ b/gosora_example.service @@ -1,6 +1,6 @@ # An example systemd service file [Unit] -Description=A service for the Gosora Forum Software +Description=Gosora [Service] Type=simple @@ -10,8 +10,10 @@ Type=simple Restart=on-failure RestartSec=10 -# Set this to the location of Gosora -ExecStart=/home/gosora/gosora +# Set these to the location of Gosora +WorkingDirectory=/home/gosora +# Make sure you manually run pre-run-linux before you start the service +ExecStart=/home/gosora/Gosora [Install] WantedBy=multi-user.target \ No newline at end of file diff --git a/pre-run-linux b/pre-run-linux new file mode 100644 index 00000000..07e7dc5c --- /dev/null +++ b/pre-run-linux @@ -0,0 +1,33 @@ +echo "Deleting artifacts from previous builds" +rm -f template_*.go +rm -f gen_*.go +rm -f tmpl_client/template_*.go +rm -f ./Gosora + +echo "Generating the dynamic code" +go generate + +echo "Building the router generator" +cd ./router_gen +go build -o RouterGen +mv ./RouterGen .. +cd .. +echo "Running the router generator" +./RouterGen + +echo "Building the query generator" +cd ./query_gen +go build -o QueryGen +mv ./QueryGen .. +cd .. +echo "Running the query generator" +./QueryGen + +echo "Building Gosora" +go build -o Gosora + +echo "Building the templates" +./Gosora -build-templates + +echo "Building Gosora... Again" +go build -o Gosora \ No newline at end of file