-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: replace packr and add basic cache headers
Since packr have been deprecated in favor of go:embed for quite some time now I have replaced it with plain go:embed functionality which makes it more future proof. The only downside is that go:embed can use relativ paths only, that's why I have moved the web/dist folder into api/public. Besides that I have refactored the static asset handling which includes basic last modification and cache control headers to improve the cache cache behavior for static assets.
- Loading branch information
Showing
10 changed files
with
89 additions
and
95 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
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 |
---|---|---|
|
@@ -56,7 +56,6 @@ tasks: | |
GORELEASER_VERSION: "0.183.0" | ||
GOLINTER_VERSION: "1.46.2" | ||
cmds: | ||
- go install github.com/gobuffalo/packr/[email protected] | ||
- go install github.com/snikch/goodman/cmd/goodman@latest | ||
- go install github.com/go-swagger/go-swagger/cmd/[email protected] | ||
- '{{ if ne OS "windows" }} sh -c "curl -L https://github.com/goreleaser/goreleaser/releases/download/v{{ .GORELEASER_VERSION }}/goreleaser_$(uname -s)_$(uname -m).tar.gz | tar -xz -C $(go env GOPATH)/bin goreleaser"{{ else }} {{ end }}' | ||
|
@@ -84,25 +83,17 @@ tasks: | |
- babel.config.js | ||
- vue.config.js | ||
generates: | ||
- dist/css/*.css | ||
- dist/js/*.js | ||
- dist/index.html | ||
- dist/favicon.ico | ||
- ../api/public/css/*.css | ||
- ../api/public/js/*.js | ||
- ../api/public/index.html | ||
- ../api/public/favicon.ico | ||
cmds: | ||
- npm run build | ||
|
||
compile:be: | ||
desc: Runs Packr for static assets | ||
sources: | ||
- web/dist/* | ||
- db/migrations/* | ||
generates: | ||
- db/db-packr.go | ||
- api/api-packr.go | ||
desc: Generate the version | ||
cmds: | ||
- mkdir -p web/dist | ||
- go run util/version_gen/generator.go {{ if .TAG }}{{ .TAG }}{{ else }}{{ if .SEMAPHORE_VERSION }}{{ .SEMAPHORE_VERSION }}{{ else }}{{ .BRANCH }}-{{ .SHA }}-{{ .TIMESTAMP }}{{ if .DIRTY }}-dirty{{ end }}{{ end }}{{end}} | ||
- packr | ||
vars: | ||
TAG: | ||
sh: git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null | sed -n 's/^\([^^~]\{1,\}\)\(\^0\)\{0,1\}$/\1/p' | ||
|
@@ -148,7 +139,7 @@ tasks: | |
lint:be: | ||
# --errors | ||
cmds: | ||
- golangci-lint run --skip-files "\w*(-packr.go)" --disable goconst --timeout 240s ./... | ||
- golangci-lint run --disable goconst --timeout 240s ./... | ||
|
||
test: | ||
cmds: | ||
|
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
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
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
Oops, something went wrong.