cloud-control-panel/Makefile

107 lines
2.5 KiB
Makefile

GITCOMMIT = $(shell git rev-list -1 HEAD)
GOVERSION = $(shell go version | cut -d' ' -f 3)
BUILDTIME = $(shell date -u --iso-8601=seconds)
VERSION = $(shell cat resources/VERSION)
# GO111MODULE=on
# try go get github.com/ahmetb/govvv
# this will add branch info & build RFC3339 date also
run:
@echo your version of go must be greater than 2.10. Your version is ${GOVERSION}
cd build && make
./build/build
./cloud-control-panel
build:
./build/build
build-all:
GOOS=linux GOARCH=386 go build -o bin/linux.x32.bin
GOOS=freebsd GOARCH=386 go build -o bin/freebsd.x32.bin
GOOS=darwin GOARCH=386 go build -o bin/darwin.x32.bin
default-config: config-delete
echo loading the test config
./cloud-control-panel --defaultconfig
debug:
@echo your version of go must be greater than 2.10. Your version is ${GOVERSION}
go build -ldflags "-X main.GITCOMMIT=${GITCOMMIT} -X main.GOVERSION='${GOVERSION}' -X main.BUILDTIME='${BUILDTIME}' -X main.VERSION=${VERSION}"
./cloud-control-panel --debug
nogui:
go build
./cloud-control-panel -nogui
gaper:
# 'gaper' is a simple and smart golang tool that just rebuilds every time you change a file
# go get -u github.com/maxcnunes/gaper
gaper
#### NEVER DO THIS. THIS APPEARS TO INDUCE INSTABILITY IN GTK
bad-run:
#### NEVER DO THIS. THIS APPEARS TO INDUCE INSTABILITY IN GTK
# go run *.go
# simple sortcut to push all git changes
push:
git checkout devel
git pull
git add --all
-git commit -a -s
git push --all
tag-version:
# git push --delete origin v0.6.15 # to delete a tag upstream
git diff --quiet
go build # just an extra check to make sure the damn thing builds
git tag v${VERSION}
git push --tags
scp resources/VERSION root@mirrors.wit.com:/data/mirrors/cloud/control-panel/
# should update every go dependancy (?)
update:
git pull
go get -v -t -u .
# make the json config file human readable
config-make-readable:
cat ~/.config/cloud-control-panel.json |jq -r --tab
config-delete:
echo deleting your current config
-mv ~/.config/cloud-control-panel.json /tmp
diff:
git diff
# https://www.digitalocean.com/community/tutorials/how-to-build-go-executables-for-multiple-platforms-on-ubuntu-16-04
build-darwin:
env GOOS=darwin GOARCH=amd64 go build
build-windows:
env GOOS=windows GOARCH=amd64 go build
go-env:
go env
git-config:
git config --list
git-remote:
git remote -v
# git branch devel
# git push --set-upstream origin devel
devel:
git checkout devel
merge-devel:
git checkout master
git pull origin master
git merge devel
git push origin master
git checkout devel