Skip to content

Commit

Permalink
Update build tag for PD integration
Browse files Browse the repository at this point in the history
Signed-off-by: Breezewish <me@breeswish.org>
  • Loading branch information
breezewish committed Jan 6, 2020
1 parent bf777da commit 2082b0f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release-ui-assets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
${{ runner.os }}-go-
- name: Build UI
run: |
make ui_for_pd
DASHBOARD_API="/dashboard" make ui
- name: Pack UI asset release
working-directory: ui/build
run: |
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
asset_content_type: application/zip
- name: Generate embedded assets
run: |
scripts/embed_ui_assets.sh
BUILD_TAG="dashboard_ui" scripts/embed_ui_assets.sh
cp pkg/uiserver/embedded_assets_handler.go embedded_assets_handler.go
- name: Pack embedded assets
run: |
Expand Down
16 changes: 9 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.PHONY: tidy ui server run
.PHONY: tidy swagger_spec yarn_dependencies swagger_client ui server run

DASHBOARD_API ?=

BUILD_TAGS ?=

Expand All @@ -20,16 +22,16 @@ swagger_spec:
scripts/generate_swagger_spec.sh

yarn_dependencies:
cd ui && yarn install --frozen-lockfile
cd ui &&\
yarn install --frozen-lockfile

swagger_client: swagger_spec yarn_dependencies
cd ui && npm run build_api_client
cd ui &&\
npm run build_api_client

ui: swagger_client
cd ui && REACT_APP_DASHBOARD_API_URL="" npm run build

ui_for_pd: swagger_client
cd ui && REACT_APP_DASHBOARD_API_URL="/dashboard" npm run build
cd ui &&\
REACT_APP_DASHBOARD_API_URL="${DASHBOARD_API}" npm run build

server:
ifeq ($(SWAGGER),1)
Expand Down
4 changes: 3 additions & 1 deletion scripts/embed_ui_assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ cd $PROJECT_DIR
export GOBIN=$PROJECT_DIR/bin
export PATH=$GOBIN:$PATH

: "${BUILD_TAG:=ui_server}"

echo "+ Preflight check"
if [ ! -d "ui/build" ]; then
echo " - Error: UI assets must be built first"
Expand All @@ -26,7 +28,7 @@ go install github.com/elazarl/go-bindata-assetfs/go-bindata-assetfs
go install github.com/go-bindata/go-bindata/go-bindata

echo "+ Embed UI assets"
go-bindata-assetfs -pkg uiserver -prefix ui -tags ui_server ui/build/...
go-bindata-assetfs -pkg uiserver -prefix ui -tags $BUILD_TAG ui/build/...
HANDLER_PATH=pkg/uiserver/embedded_assets_handler.go
mv bindata_assetfs.go $HANDLER_PATH
echo " - Assets handler written to $HANDLER_PATH"
2 changes: 1 addition & 1 deletion ui/.github_release_version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# This file contains a version number which will be used to release assets to
# GitHub. To trigger a new asset release, simply increase this version number.
20200106_1
20200106_2

0 comments on commit 2082b0f

Please sign in to comment.