Skip to content

Commit

Permalink
simplify script
Browse files Browse the repository at this point in the history
  • Loading branch information
xxchan committed Sep 19, 2023
1 parent 529f26c commit 88ff60c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 25 deletions.
36 changes: 12 additions & 24 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -360,35 +360,24 @@ alias = "build-risingwave"
[tasks.build]
alias = "build-risingwave"

[tasks.extract-dashboard-artifact]
[tasks.prepare-dashboard]
private = true
category = "RiseDev - Build"
description = "Extract dashboard artifact"
condition = { env_not_set = ["ENABLE_BUILD_DASHBOARD"] }
script = '''
#!/usr/bin/env bash
# we allow this script to fail
echo "Extracting dashboard artifacts to ${PREFIX_UI}"
rm -rf "${PREFIX_UI}"
git worktree prune
git worktree add "${PREFIX_UI}" origin/dashboard-artifact
'''

[tasks.export-dashboard]
private = true
category = "RiseDev - Build"
description = "Build dashboard"
condition = { env_set = ["ENABLE_BUILD_DASHBOARD"] }
description = "Download or build dashboard"
script = """
#!/usr/bin/env bash
set -e
rm -rf "${PREFIX_UI}"
cd dashboard && npm run build-static
cd .. && ln -s "$(pwd)/dashboard/out" "${PREFIX_UI}"
if [[ -z "$ENABLE_BUILD_DASHBOARD" ]]; then
echo "Extracting dashboard artifacts to ${PREFIX_UI}"
git worktree prune
git worktree add "${PREFIX_UI}" origin/dashboard-artifact
else
cd dashboard && npm run build-static
cd .. && ln -s "$(pwd)/dashboard/out" "${PREFIX_UI}"
fi
"""

[tasks.build-risingwave]
Expand Down Expand Up @@ -522,8 +511,7 @@ dependencies = [
"build-risingwave",
"build-connector-node",
"post-build-risingwave",
"extract-dashboard-artifact",
"export-dashboard",
"prepare-dashboard",
"prepare-config",
]

Expand Down
2 changes: 1 addition & 1 deletion dashboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ To replace the built static files in RisingWave with your newest code,
run the following scripts in the root directory.

```bash
./risedev export-dashboard
./risedev prepare-dashboard
```

## Deployment
Expand Down

0 comments on commit 88ff60c

Please sign in to comment.