summaryrefslogtreecommitdiff
path: root/Makefile
blob: 8450c662bf76f96835c2739444b7ea40c0fa8d3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
VERSION = $(shell git describe --tags)

# create the go.mod and go.sum if this is a brand new repo
# REDOMOD = $(shell if [ -e go.mod ]; then  echo go.mod; else echo no go mod; fi)
REDOMOD = $(shell if [ -e go.sum ]; then  echo go.sum exists; else GO111MODULE= go mod init; GO111MODULE= go mod tidy; fi)

all:
	GO111MODULE=off go build -v -ldflags "-X main.Version=${VERSION} -X gui.GUIVERSION=${VERSION}"
	./virtigo --version
	./virtigo --hosts farm01 farm02 farm03
	./virtigo --start jcarr

start-all-droplets:
	curl --silent http://localhost:8080/start?start=git.wit.org
	curl --silent http://localhost:8080/start?start=go.wit.com
	curl --silent http://localhost:8080/start?start=rdate.wit.com
	curl --silent http://localhost:8080/start?start=uptime.wit.com
	curl --silent http://localhost:8080/start?start=www.wit.com
	curl --silent http://localhost:8080/start?start=ping.wit.com
	curl --silent http://localhost:8080/start?start=wekan.wit.com
	curl --silent http://localhost:8080/start?start=caddy.wit.org
	curl --silent http://localhost:8080/start?start=immich.wit.org
	curl --silent http://localhost:8080/start?start=bernacchi
	@#curl --silent http://localhost:8080/start?start=jcarr
	@# ./virtigo --start jcarr

curl-uptime:
	curl --silent http://localhost:8080/uptime

curl-droplets:
	curl --silent http://localhost:8080/droplets

# this is for release builds using the go.mod files
release-build:
	@echo ${REDOMOD}
	go build -v -ldflags "-X main.Version=${VERSION} -X gui.GUIVERSION=${VERSION}"

# autofixes your import headers in your golang files
goimports:
	goimports -w *.go

# remake the go.mod and go.sum files
redomod:
	rm -f go.*
	GO111MODULE= go mod init
	GO111MODULE= go mod tidy

clean:
	rm -f go.*
	rm -f virtigo*

# git clone the sources and all the golang dependancies into ~/go/src
# if you don't have go-clone, you can get it from http://go.wit.com/
git-clone:
	go-clone --recursive --go-src --no-work go.wit.com/apps/go-clone
	go-clone --recursive --go-src --no-work go.wit.com/apps/virtigo
	go-clone --recursive --go-src --no-work go.wit.com/apps/gowebd
	go-clone --recursive --go-src --no-work go.wit.com/lib/daemons/virtigod