mirror of
https://github.com/pldubouilh/gossa
synced 2025-12-06 08:22:32 +01:00
refactor makefile
This commit is contained in:
parent
57a9f2dbc8
commit
c4aab1503b
3 changed files with 8 additions and 11 deletions
19
Makefile
19
Makefile
|
|
@ -1,32 +1,29 @@
|
||||||
build:
|
run:
|
||||||
make embed
|
make embed
|
||||||
|
go vet && go fmt
|
||||||
CGO_ENABLED=0 go build gossa.go
|
CGO_ENABLED=0 go build gossa.go
|
||||||
rm gossa.go
|
rm gossa.go
|
||||||
|
./gossa fixture
|
||||||
|
|
||||||
|
watch:
|
||||||
|
ls src/* | entr -rc make run
|
||||||
|
|
||||||
embed:
|
embed:
|
||||||
echo "embedding css and js into binary"
|
echo "embedding css and js into binary"
|
||||||
cp src/main.go gossa.go
|
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/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/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/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
|
perl -pe 's/favicon_will_be_here/`base64 -w0 src\/favicon.png`/ge' -i gossa.go
|
||||||
|
|
||||||
run:
|
|
||||||
make build
|
|
||||||
./gossa fixture
|
|
||||||
|
|
||||||
ci:
|
ci:
|
||||||
cd src && go vet && go fmt
|
|
||||||
timeout 10 make run &
|
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:
|
ci-watch:
|
||||||
ls src/* | entr -rc make ci
|
ls src/* | entr -rc make ci
|
||||||
|
|
||||||
watch:
|
|
||||||
ls src/* | entr -rc make run
|
|
||||||
|
|
||||||
build-all:
|
build-all:
|
||||||
make embed
|
make embed
|
||||||
env GOOS=linux GOARCH=amd64 go build gossa.go
|
env GOOS=linux GOARCH=amd64 go build gossa.go
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue