task based building
parent
2ad2e5114d
commit
0929b399ef
@ -0,0 +1 @@
|
||||
d7788877e33ce296459440d6cd0fdbd5
|
@ -0,0 +1,46 @@
|
||||
version: '3'
|
||||
|
||||
tasks:
|
||||
clean:
|
||||
desc: "clean all of the old binaries"
|
||||
cmds:
|
||||
- rm -v bin/* 2>/dev/null
|
||||
|
||||
all:
|
||||
desc: "cleans and builds all"
|
||||
deps: [clean, bb, server]
|
||||
|
||||
bb:
|
||||
desc: "Builds and sends to the beaglebone"
|
||||
cmds:
|
||||
- task: go-build
|
||||
vars:
|
||||
GOARM: 7
|
||||
GOARCH: "arm"
|
||||
GOOS: "linux"
|
||||
BUILD_DIR: "reactor"
|
||||
- scp bin/{{.BUILD_DIR}}_{{.GOOS}}_{{.GOARCH}} debian:~/
|
||||
|
||||
server:
|
||||
desc: "Builds server binary"
|
||||
cmds:
|
||||
- task: go-build
|
||||
vars:
|
||||
BUILD_DIR: "server"
|
||||
GOOS: "{{OS}}"
|
||||
GOARCH: "{{ARCH}}"
|
||||
|
||||
go-build:
|
||||
internal: true
|
||||
cmds:
|
||||
- go build -o bin/{{.BUILD_DIR}}_{{.GOOS}}_{{.GOARCH}} cmd/{{.BUILD_DIR}}/main.go
|
||||
sources:
|
||||
- internal/pkg/**/*.go
|
||||
- cmd/{{.BUILD_DIR}}/main.go
|
||||
generates:
|
||||
- bin/{{.BUILD_DIR}}_{{.GOOS}}_{{.GOARCH}}
|
||||
env:
|
||||
GOARM: "{{.GOARM}}"
|
||||
GOARCH: "{{.GOARCH}}"
|
||||
GOOS: "{{.GOOS}}"
|
||||
|
Loading…
Reference in New Issue