2019-05-23 02:11:49 -05:00
|
|
|
GITCOMMIT = $(shell git rev-list -1 HEAD)
|
|
|
|
GOVERSION = $(shell go version | cut -d' ' -f 3)
|
2019-05-23 11:47:48 -05:00
|
|
|
BUILDTIME = $(shell date -u --iso-8601=seconds)
|
2019-06-06 22:56:14 -05:00
|
|
|
VERSION = $(shell cat resources/VERSION)
|
2019-05-23 11:47:48 -05:00
|
|
|
|
2019-06-14 20:11:31 -05:00
|
|
|
# GO111MODULE=on
|
2019-06-06 15:54:17 -05:00
|
|
|
|
2019-05-23 11:47:48 -05:00
|
|
|
# try go get github.com/ahmetb/govvv
|
|
|
|
# this will add branch info & build RFC3339 date also
|
|
|
|
|
2019-05-24 00:47:26 -05:00
|
|
|
run:
|
2019-05-23 11:47:48 -05:00
|
|
|
@echo your version of go must be greater than 2.10. Your version is ${GOVERSION}
|
2019-06-14 20:11:31 -05:00
|
|
|
cd build && make
|
2019-06-11 01:39:34 -05:00
|
|
|
./build/build
|
2019-05-24 00:47:26 -05:00
|
|
|
./cloud-control-panel
|
2019-05-22 11:05:23 -05:00
|
|
|
|
2019-06-06 22:08:36 -05:00
|
|
|
build:
|
2019-06-11 01:39:34 -05:00
|
|
|
./build/build
|
2019-06-06 22:08:36 -05:00
|
|
|
|
2019-06-16 11:56:52 -05:00
|
|
|
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
|
|
|
|
|
2019-06-04 16:09:43 -05:00
|
|
|
default-config: config-delete
|
|
|
|
echo loading the test config
|
|
|
|
./cloud-control-panel --defaultconfig
|
|
|
|
|
2019-05-24 00:47:26 -05:00
|
|
|
debug:
|
2019-05-23 02:11:49 -05:00
|
|
|
@echo your version of go must be greater than 2.10. Your version is ${GOVERSION}
|
2019-06-02 00:24:26 -05:00
|
|
|
go build -ldflags "-X main.GITCOMMIT=${GITCOMMIT} -X main.GOVERSION='${GOVERSION}' -X main.BUILDTIME='${BUILDTIME}' -X main.VERSION=${VERSION}"
|
2019-05-29 04:28:19 -05:00
|
|
|
./cloud-control-panel --debug
|
2019-05-06 02:32:46 -05:00
|
|
|
|
2019-05-09 09:00:38 -05:00
|
|
|
nogui:
|
|
|
|
go build
|
|
|
|
./cloud-control-panel -nogui
|
|
|
|
|
2019-05-06 02:32:46 -05:00
|
|
|
gaper:
|
2019-02-01 07:28:17 -06:00
|
|
|
# '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
|
|
|
|
|
2019-05-08 17:29:06 -05:00
|
|
|
#### NEVER DO THIS. THIS APPEARS TO INDUCE INSTABILITY IN GTK
|
2019-05-09 08:52:51 -05:00
|
|
|
bad-run:
|
2019-05-08 17:29:06 -05:00
|
|
|
#### NEVER DO THIS. THIS APPEARS TO INDUCE INSTABILITY IN GTK
|
|
|
|
# go run *.go
|
|
|
|
|
2019-02-01 07:28:17 -06:00
|
|
|
# simple sortcut to push all git changes
|
|
|
|
push:
|
2019-06-03 14:56:20 -05:00
|
|
|
git checkout devel
|
2019-02-01 07:28:17 -06:00
|
|
|
git pull
|
|
|
|
git add --all
|
|
|
|
-git commit -a -s
|
2019-05-11 09:53:32 -05:00
|
|
|
git push --all
|
2019-06-02 22:54:33 -05:00
|
|
|
|
2019-06-06 23:43:14 -05:00
|
|
|
tag-version:
|
2019-06-07 11:51:45 -05:00
|
|
|
# git push --delete origin v0.6.15 # to delete a tag upstream
|
2019-06-07 13:02:00 -05:00
|
|
|
git diff --quiet
|
|
|
|
go build # just an extra check to make sure the damn thing builds
|
2019-06-02 23:56:15 -05:00
|
|
|
git tag v${VERSION}
|
|
|
|
git push --tags
|
2019-06-07 13:06:58 -05:00
|
|
|
scp resources/VERSION root@mirrors.wit.com:/data/mirrors/cloud/control-panel/
|
2019-02-01 07:28:17 -06:00
|
|
|
|
|
|
|
# should update every go dependancy (?)
|
|
|
|
update:
|
|
|
|
git pull
|
2019-05-21 20:00:45 -05:00
|
|
|
go get -v -t -u .
|
2019-05-07 07:40:07 -05:00
|
|
|
|
|
|
|
# make the json config file human readable
|
2019-05-29 14:46:44 -05:00
|
|
|
config-make-readable:
|
2019-05-24 19:39:05 -05:00
|
|
|
cat ~/.config/cloud-control-panel.json |jq -r --tab
|
2019-05-10 03:45:10 -05:00
|
|
|
|
2019-05-29 14:46:44 -05:00
|
|
|
config-delete:
|
|
|
|
echo deleting your current config
|
2019-05-31 19:37:24 -05:00
|
|
|
-mv ~/.config/cloud-control-panel.json /tmp
|
2019-05-23 15:27:05 -05:00
|
|
|
|
2019-05-10 03:45:10 -05:00
|
|
|
diff:
|
|
|
|
git diff
|
2019-05-15 17:32:40 -05:00
|
|
|
|
|
|
|
# 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
|
2019-06-01 01:29:46 -05:00
|
|
|
|
2019-06-16 11:56:52 -05:00
|
|
|
go-env:
|
|
|
|
go env
|
|
|
|
|
|
|
|
git-config:
|
|
|
|
git config --list
|
|
|
|
|
|
|
|
git-remote:
|
|
|
|
git remote -v
|
|
|
|
|
2019-06-01 01:29:46 -05:00
|
|
|
# git branch devel
|
|
|
|
# git push --set-upstream origin devel
|
|
|
|
devel:
|
|
|
|
git checkout devel
|
2019-06-01 17:43:08 -05:00
|
|
|
|
|
|
|
merge-devel:
|
|
|
|
git checkout master
|
|
|
|
git pull origin master
|
|
|
|
git merge devel
|
|
|
|
git push origin master
|
|
|
|
git checkout devel
|