diff --git a/Makefile b/Makefile index 7b18662..7c74da0 100755 --- a/Makefile +++ b/Makefile @@ -1,32 +1,29 @@ -build: +run: make embed + go vet && go fmt CGO_ENABLED=0 go build gossa.go rm gossa.go + ./gossa fixture + +watch: + ls src/* | entr -rc make run embed: echo "embedding css and js into binary" cp src/main.go gossa.go - perl -pe 's/template_will_be_here/`cat src\/page.tmpl`/ge' -i gossa.go + perl -pe 's/template_will_be_here/`cat src\/template.go`/ge' -i gossa.go perl -pe 's/css_will_be_here/`cat src\/style.css`/ge' -i gossa.go perl -pe 's/theme_will_be_here/`cat src\/theme.css`/ge' -i gossa.go perl -pe 's/js_will_be_here/`cat src\/script.js`/ge' -i gossa.go perl -pe 's/favicon_will_be_here/`base64 -w0 src\/favicon.png`/ge' -i gossa.go -run: - make build - ./gossa fixture - ci: - cd src && go vet && go fmt timeout 10 make run & - cd src && sleep 5 && go test + cp src/gossa_test.go . && sleep 5 && go test; rm gossa gossa_test.go ci-watch: ls src/* | entr -rc make ci -watch: - ls src/* | entr -rc make run - build-all: make embed env GOOS=linux GOARCH=amd64 go build gossa.go diff --git a/src/main_test.go b/src/gossa_test.go similarity index 100% rename from src/main_test.go rename to src/gossa_test.go diff --git a/src/page.tmpl b/src/template.go similarity index 100% rename from src/page.tmpl rename to src/template.go