Explorar el Código

Baseline prep work

Initialized Client and Server codebases, including build and (run) server scripts.
Steve Thielemann hace 1 año
padre
commit
405a262e74
Se han modificado 5 ficheros con 95 adiciones y 0 borrados
  1. 8 0
      .gitignore
  2. 3 0
      Client/go.mod
  3. 3 0
      Server/go.mod
  4. 66 0
      build
  5. 15 0
      server

+ 8 - 0
.gitignore

@@ -0,0 +1,8 @@
+# Folders
+.bin
+doorgo
+
+# Files
+*.log
+*.lock
+

+ 3 - 0
Client/go.mod

@@ -0,0 +1,3 @@
+module git.red-green.com/david/core-client
+
+go 1.21.0

+ 3 - 0
Server/go.mod

@@ -0,0 +1,3 @@
+module git.red-green.com/david/core-server
+
+go 1.21.0

+ 66 - 0
build

@@ -0,0 +1,66 @@
+#!/bin/bash
+
+echo "[0/7] Building..."
+
+if ! [ -d "doorgo" ]; then
+	echo "[1/7] Cloning doorgo library"
+	git clone https://git.red-green.com/RedGreen/doorgo --depth 1
+else
+	echo "[1/7] Updating doorgo library"
+	cd doorgo
+	git pull --no-rebase
+	cd ..
+fi
+
+if ! [ -d ".bin" ]; then
+	echo "[2/7] Making binary directory"
+	mkdir .bin
+else
+	echo "[2/7] Cleaning binary directory"
+	rm -rf .bin
+	mkdir .bin
+fi
+
+if ! [ -d "Server" ]; then
+	echo "[3/7] Missing server codebase"
+	echo "Please try 'git pull' or report this https://git.red-green.com/david/Core/issues/new"
+	exit -1
+else
+	echo "[3/7] Found server codebase"
+fi
+if ! [ -d "Client" ]; then
+	echo "[4/7] Missing client codebase"
+	echo "Please try 'git pull' or report this https://git.red-green.com/david/Core/issues/new"
+	exit -1
+else
+	echo "[4/7] Found client codebase"
+fi
+
+echo "[5/7] Building server..."
+cd Server
+go build
+if ! [ -f "core-server" ]; then
+	echo "[5/7] Failed"
+	echo "Please report this https://git.red-green.com/david/Core/issues/new"
+	exit -1
+else
+	echo "[5/7] Ok"
+	mv core-server ../.bin/core-server
+	cd ..
+fi
+
+echo "[6/7] Building client..."
+cd Client
+go build
+if ! [ -f "core-client" ]; then
+	echo "[6/7] Failed"
+	echo "Please report this https://git.red-green.com/david/Core/issues/new"
+	exit -1
+else
+	echo "[6/7] Ok"
+	mv core-client ../.bin/core-client
+	cd ..
+fi
+
+echo "[7/7] Done"
+

+ 15 - 0
server

@@ -0,0 +1,15 @@
+#!/bin/bash
+
+if ! [ -d ".bin" ]; then
+	echo "Missing binary directory"
+	echo "Please run 'build' or report this https://git.red-green.com/david/Core/issues/new"
+	exit -1
+fi
+if ! [ -f ".bin/core-server" ]; then
+	echo "Missing server binary"
+	echo "Please run 'build' or report this https://git.red-green.com/david/Core/issues/new"
+	exit -1
+fi
+
+./.bin/core-server
+