-
-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
24 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
**/rice-box.go | ||
/admin/.env | ||
/admin/.next | ||
/admin/dist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,34 @@ | ||
PACKAGE_NAME := github.com/dstotijn/hetty | ||
GOLANG_CROSS_VERSION ?= v1.15.2 | ||
|
||
setup: | ||
go mod download | ||
go generate ./... | ||
.PHONY: setup | ||
|
||
.PHONY: embed | ||
embed: | ||
go install github.com/GeertJohan/go.rice/rice | ||
NEXT_TELEMETRY_DISABLED=1 cd admin && yarn install && yarn run export | ||
cd cmd/hetty && rice embed-go | ||
.PHONY: embed | ||
|
||
build: embed | ||
env CGO_ENABLED=1 go build ./cmd/hetty | ||
.PHONY: build | ||
build: embed | ||
CGO_ENABLED=1 go build ./cmd/hetty | ||
|
||
clean: | ||
rm -rf cmd/hetty/rice-box.go | ||
.PHONY: clean | ||
|
||
release-dry-run: | ||
.PHONY: release-dry-run | ||
release-dry-run: embed | ||
@docker run \ | ||
--rm \ | ||
-v `pwd`:/go/src/$(PACKAGE_NAME) \ | ||
-v `pwd`/admin/dist:/go/src/$(PACKAGE_NAME)/admin/dist \ | ||
-w /go/src/$(PACKAGE_NAME) \ | ||
troian/golang-cross:${GOLANG_CROSS_VERSION} \ | ||
--rm-dist --skip-validate --skip-publish | ||
.PHONY: release-dry-run | ||
|
||
release: | ||
.PHONY: release | ||
release: embed | ||
@if [ ! -f ".release-env" ]; then \ | ||
echo "\033[91mFile \`.release-env\` is missing.\033[0m";\ | ||
exit 1;\ | ||
fi | ||
@docker run \ | ||
--rm \ | ||
-v `pwd`:/go/src/$(PACKAGE_NAME) \ | ||
-v `pwd`/admin/dist:/go/src/$(PACKAGE_NAME)/admin/dist \ | ||
-w /go/src/$(PACKAGE_NAME) \ | ||
--env-file .release-env \ | ||
troian/golang-cross:${GOLANG_CROSS_VERSION} \ | ||
release --rm-dist | ||
.PHONY: release | ||
release --rm-dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,11 +37,23 @@ and web based admin interface. | |
|
||
### Build from source | ||
|
||
#### Prerequisites | ||
|
||
- [Go](https://golang.org/) | ||
- [Yarn](https://yarnpkg.com/) | ||
- [go.rice](https://github.com/GeertJohan/go.rice) | ||
|
||
Hetty depends on SQLite (via [mattn/go-sqlite3](https://github.com/mattn/go-sqlite3)) | ||
and needs `cgo` to compile. | ||
and needs `cgo` to compile. Additionally, the static resources for the admin interface | ||
(Next.js) need to be generated via [Yarn](https://yarnpkg.com/) and embedded in | ||
a `.go` file with [go.rice](https://github.com/GeertJohan/go.rice) beforehand. | ||
|
||
Clone the repository and use the `build` make target to create a binary: | ||
|
||
``` | ||
$ GO111MODULE=auto CGO_ENABLED=1 go get -u github.com/dstotijn/hetty/cmd/hetty | ||
$ git clone [email protected]:dstotijn/hetty.git | ||
$ cd hetty | ||
$ make build | ||
``` | ||
|
||
### Docker | ||
|