Add basic Go build system

This commit is contained in:
Radon Rosborough 2021-07-03 05:12:18 +00:00
parent 61cb3d1bea
commit e92b2aea4f
5 changed files with 28 additions and 2 deletions

View File

@ -147,16 +147,22 @@ system: # Compile setuid binary for production
system-dev: # Compile and watch setuid binary for development
watchexec -w system/src -n -- ./system/compile.bash
supervisor: # Compile supervisor binary for production
./supervisor/compile.bash
supervisor-dev: # Compile and watch supervisor binary for development
watchexec -w supervisor/src -n -- ./supervisor/compile.bash
server: # Run server for production
node backend/server.js
server-dev: # Run and restart server for development
watchexec -w backend -r -n -- node backend/server.js
build: frontend system # Compile all artifacts for production
build: frontend system supervisor # Compile all artifacts for production
dev: # Compile, run, and watch all artifacts and server for development
$(MAKE_QUIETLY) -j3 frontend-dev system-dev server-dev
$(MAKE_QUIETLY) -j3 frontend-dev system-dev supervisor-dev server-dev
### Application tools

View File

@ -37,6 +37,7 @@ dctrl-tools
docker-ce-cli
g++
git
golang
htop
jq
less

7
supervisor/compile.bash Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
cd supervisor
mkdir -p out
go build -o out/riju-supervisor ./src

3
supervisor/go.mod Normal file
View File

@ -0,0 +1,3 @@
module github.com/raxod502/riju/supervisor
go 1.16

9
supervisor/src/main.go Normal file
View File

@ -0,0 +1,9 @@
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello, world!")
}