2024-10-31 06:41:30 -05:00
|
|
|
.PHONY: build
|
|
|
|
|
2024-10-11 13:55:13 -05:00
|
|
|
VERSION = $(shell git describe --tags)
|
2024-11-16 00:08:34 -06:00
|
|
|
BUILDTIME = $(shell date +%Y.%m.%d)
|
2024-10-11 13:55:13 -05:00
|
|
|
|
|
|
|
# create the go.mod and go.sum if this is a brand new repo
|
|
|
|
REDOMOD = $(shell if [ -e go.sum ]; then echo go.sum exists; else GO111MODULE= go mod init; GO111MODULE= go mod tidy; fi)
|
|
|
|
|
2024-11-02 23:46:53 -05:00
|
|
|
check_files:
|
2024-11-03 01:41:00 -05:00
|
|
|
@echo
|
|
|
|
@echo the build is complicated right now because you need
|
|
|
|
@echo the google version of protoc-gen-go which is not the one in debian sid yet
|
|
|
|
@echo
|
2024-11-02 23:46:53 -05:00
|
|
|
@if [ -f "/usr/bin/bin/protoc-gen-go" ]; then \
|
|
|
|
echo "the protoc-gen-go package is old in debian sid right now"; \
|
|
|
|
echo "for now, remove it"; \
|
|
|
|
apt remote proto-gen-go \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
@if [ ! -f "../../lib/protobuf/virtbuf/droplet.pb.go" ]; then \
|
|
|
|
echo "you must build the protobuf files first"; \
|
|
|
|
echo "They should be in: ../../lib/protobuf/virtbuf/droplet.pb.go"; \
|
|
|
|
make -C ../../lib/protobuf/virtbuf/; \
|
|
|
|
fi
|
|
|
|
@if [ ! -f "$(HOME)/go/bin/protoc-gen-go" ]; then \
|
|
|
|
echo "you must build protoc-gen-go from google"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
make all
|
2024-11-02 09:14:48 -05:00
|
|
|
|
|
|
|
all:
|
|
|
|
make build
|
2024-10-11 13:55:13 -05:00
|
|
|
./virtigo --version
|
2024-11-02 09:14:48 -05:00
|
|
|
@echo build worked
|
2024-10-11 13:55:13 -05:00
|
|
|
|
2024-10-26 01:02:09 -05:00
|
|
|
build:
|
2024-11-16 00:08:34 -06:00
|
|
|
GO111MODULE=off go build \
|
|
|
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
|
|
|
|
|
|
|
verbose:
|
|
|
|
GO111MODULE=off go build -v -x \
|
|
|
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
|
|
|
|
|
|
|
install:
|
|
|
|
GO111MODULE=off go install \
|
|
|
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
2024-10-26 01:02:09 -05:00
|
|
|
|
2024-10-30 20:31:14 -05:00
|
|
|
# makes a .deb package
|
|
|
|
debian:
|
|
|
|
rm -f ~/incoming/virtigo*deb
|
|
|
|
go-deb --no-gui --repo go.wit.com/apps/virtigo
|
|
|
|
|
2024-10-23 02:56:55 -05:00
|
|
|
xml-add:
|
2024-10-25 20:09:41 -05:00
|
|
|
./virtigo --libvirt ~/libvirt/*.xml --xml-ignore-disk=true
|
2024-10-23 02:56:55 -05:00
|
|
|
|
2024-10-26 01:02:09 -05:00
|
|
|
xml-add-save:
|
|
|
|
./virtigo --libvirt ~/libvirt/*.xml --xml-ignore-disk=true --save
|
|
|
|
|
2024-10-26 02:31:52 -05:00
|
|
|
start-pihole.wit.com: build
|
|
|
|
rm -f /tmp/blahcarr.xml /tmp/pihole.wit.com.xml
|
|
|
|
./virtigo --start pihole.wit.com
|
|
|
|
./virtigo --libvirt /tmp/pihole.wit.com.xml
|
2024-10-25 22:07:28 -05:00
|
|
|
|
2024-10-26 12:32:17 -05:00
|
|
|
start-pihole.wit.com-http:
|
2024-10-27 02:29:45 -05:00
|
|
|
curl --silent http://localhost:8080/start?hostname=pihole.wit.com
|
2024-10-26 12:32:17 -05:00
|
|
|
|
2024-10-26 01:02:09 -05:00
|
|
|
old-start-all-droplets:
|
2024-10-16 20:43:01 -05:00
|
|
|
curl --silent http://localhost:8080/start?start=git.wit.org
|
|
|
|
curl --silent http://localhost:8080/start?start=go.wit.com
|
2024-10-15 11:02:34 -05:00
|
|
|
curl --silent http://localhost:8080/start?start=rdate.wit.com
|
2024-10-16 21:10:08 -05:00
|
|
|
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
|
2024-10-15 11:02:34 -05:00
|
|
|
@#curl --silent http://localhost:8080/start?start=jcarr
|
2024-10-13 03:49:54 -05:00
|
|
|
@# ./virtigo --start jcarr
|
2024-10-13 02:23:30 -05:00
|
|
|
|
2024-10-13 03:04:46 -05:00
|
|
|
curl-uptime:
|
|
|
|
curl --silent http://localhost:8080/uptime
|
|
|
|
|
|
|
|
curl-droplets:
|
|
|
|
curl --silent http://localhost:8080/droplets
|
|
|
|
|
2024-10-23 00:48:35 -05:00
|
|
|
curl-writeconfig:
|
|
|
|
curl --silent http://localhost:8080/writeconfig
|
|
|
|
|
2024-10-11 13:55:13 -05:00
|
|
|
# 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
|
2024-10-12 00:17:26 -05:00
|
|
|
go-clone --recursive --go-src --no-work go.wit.com/apps/gowebd
|
2024-10-11 13:55:13 -05:00
|
|
|
go-clone --recursive --go-src --no-work go.wit.com/lib/daemons/virtigod
|
2024-10-26 13:05:05 -05:00
|
|
|
|
|
|
|
http-uptime:
|
|
|
|
curl --silent http://localhost:8080/uptime
|
|
|
|
|
|
|
|
http-droplets:
|
|
|
|
curl --silent http://localhost:8080/droplets
|
|
|
|
|
|
|
|
http-missing:
|
|
|
|
curl --silent http://localhost:8080/missing
|
|
|
|
|
|
|
|
http-dumplibvirtxml:
|
|
|
|
curl --silent http://localhost:8080//dumplibvirtxml
|
2024-11-02 09:14:48 -05:00
|
|
|
|
|
|
|
protogen:
|
|
|
|
go-clone google.golang.org/protobuf
|
|
|
|
cd ~/go/src/google.golang.org/protobuf/cmd/protoc-gen-go && go install
|