-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor the way the ui is embedded (#583)
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
- v0.50.1
- v0.50.0
- v0.50.0-rc.1
- v0.50.0-rc.0
- v0.49.0
- v0.49.0-rc.1
- v0.49.0-rc.0
- v0.48.0
- v0.48.0-rc.1
- v0.48.0-rc0
- v0.47.1
- v0.47.0
- v0.47.0-rc0
- v0.46.0
- v0.46.0-rc1
- v0.46.0-rc0
- v0.45.0
- v0.45.0-rc1
- v0.45.0-rc0
- v0.44.0
- v0.44.0-rc2
- v0.44.0-rc1
- v0.44.0-rc0
- v0.43.0
- v0.43.0-rc2
- v0.43.0-rc1
- v0.43.0-rc0
- v0.42.1
- v0.42.0
- v0.41.1
- v0.41.0
- v0.40.1
- v0.40.0
- v0.39.0
- v0.38.0
- v0.37.2
- v0.37.1
- v0.37.0
- v0.36.2
- v0.36.1
- v0.36.0
- v0.35.0
- v0.34.0
- v0.33.0
- v0.32.0
- v0.31.0
- v0.30.0
- v0.29.1
- v0.29.0
- v0.28.0
- v0.27.0
- v0.26.1
- v0.26.0
- v0.25.0
- v0.24.0
- v0.23.1
- v0.23.0
- v0.22.0
- v0.21.1
- v0.21.0
- v0.20.0
- v0.19.0
- v0.18.0
- v0.17.0
- v0.16.0
- v0.15.0
- v0.14.0
- v0.13.0
- v0.12.0
- v0.11.0
- v0.10.0
- v0.9.0
Showing
10 changed files
with
66 additions
and
184 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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# compress static assets | ||
|
||
set -euo pipefail | ||
|
||
cd ui | ||
cp embed.go.tmpl embed.go | ||
|
||
GZIP_OPTS="-fk" | ||
# gzip option '-k' may not always exist in the latest gzip available on different distros. | ||
if ! gzip -k -h &>/dev/null; then GZIP_OPTS="-f"; fi | ||
|
||
dist="app/dist" | ||
|
||
if ! [[ -d "${dist}" ]]; then | ||
mkdir -p ${dist} | ||
echo "<!doctype html> | ||
<html lang=\"en\"> | ||
<head> | ||
<meta charset=\"utf-8\"> | ||
<title>Node</title> | ||
<base href=\"/\"> | ||
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"> | ||
<link rel=\"icon\" type=\"image/x-icon\" href=\"favicon.ico\"> | ||
</head> | ||
<body> | ||
<div> | ||
<p> This is the default index, looks like you forget to generate the react app before generating the golang endpoint.</p> | ||
</div> | ||
</body> | ||
</html>" > ${dist}/index.html | ||
fi | ||
|
||
find app/dist -type f -name '*.gz' -delete | ||
find app/dist -type f -exec gzip $GZIP_OPTS '{}' \; -print0 | xargs -0 -I % echo %.gz | xargs echo //go:embed >> embed.go | ||
echo var embedFS embed.FS >> embed.go |
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 |
---|---|---|
|
@@ -30,3 +30,4 @@ dist | |
# ignore file copied during the release process of the UI | ||
LICENSE | ||
CHANGELOG.md | ||
/embed.go |
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