* Add mechanism for bundling UI assets. The scripts/uigen.sh script will check out the UI repo, build assets, create a static assets file, and clean up. The dev Makefile target has been modified to run this script if no assets file is found. There is also a build-ui target that will unilaterally update (the dev target only builds if the file isn't found, but doesn't update). The handler has been updated to add the default org ID as a header if the request path is "/". Co-authored-by: Randall Morey <randall@randallmorey.com>
22 lines
509 B
Bash
Executable File
22 lines
509 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
origdir=$(pwd)
|
|
tempdir=$(mktemp -d update-ui-assets.XXXXXX)
|
|
ui_commitish=${UI_COMMITISH:-develop}
|
|
|
|
cd $tempdir
|
|
git clone https://github.com/hashicorp/watchtower-ui
|
|
cd watchtower-ui
|
|
git fetch origin ${ui_commitish}
|
|
git checkout ${ui_commitish}
|
|
|
|
docker-compose -f docker-compose-embedding.yml run build
|
|
|
|
cd $origdir
|
|
|
|
go-bindata -fs -o internal/ui/assets.go -pkg ui -prefix "${origdir}/${tempdir}/watchtower-ui/ui/core/dist" "${origdir}/${tempdir}/watchtower-ui/ui/core/dist"
|
|
|
|
rm -rf $tempdir
|