-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a Makefile for building and testing the Dashboard (#3273)
Add a Makefile for the Pbench Dashboard, to allow it to be built (and re-built) only as needed and to provide an encapsulated interface for running lint and unit tests, etc. The build.sh script is changed to use make to clear and install the Dashboard dependences, to run lint, and to run unit tests. And, a new make invocation is added after we build the Server and Agent RPMs to also build the Dashboard deployment. Also, jenkins/runlocal is modified to build the Dashboard, as well.
- Loading branch information
Showing
3 changed files
with
51 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# | ||
# A Makefile for building the Pbench Dashboard deployment for use in Pbench | ||
# Server functional test and Staging/Production deployments. | ||
# | ||
# This makefile defines the following targets: | ||
# | ||
# all (the default): runs lint and unit tests and then builds | ||
# the Pbench Dashboard deployment | ||
# build: builds the Pbench Dashboard deployment | ||
# clean: removes the artifacts created by the other targets | ||
# run_lint: runs the Javascript linter | ||
# run_unittests: runs the Dashboard unit tests | ||
# | ||
|
||
# This is the list of all the subdirectories of the `dashboard` directory which | ||
# contain "source" files for the Dashboard (Javascript, images, style sheets, | ||
# HTML, et al.) -- anything which, if changed, should prompt a new build -- and | ||
# the corresponding list of those files. | ||
SRCDIRS := public src | ||
FILES := $(shell find ${SRCDIRS} -type f) | ||
|
||
all: run_lint run_unittests build | ||
|
||
build: package-lock.json node_modules ${FILES} | ||
mkdir -p build | ||
npm run build | ||
|
||
run_lint: package-lock.json node_modules | ||
npx eslint --max-warnings 0 "src/**" | ||
|
||
run_unittests: package-lock.json node_modules | ||
CI=true npm test | ||
|
||
package-lock.json node_modules &: ${HOME}/.config package.json | ||
npm install | ||
|
||
${HOME}/.config: | ||
mkdir -p ${HOME}/.config | ||
|
||
clean: | ||
rm -rf package-lock.json node_modules build | ||
|
||
.PHONY: all clean run_lint run_unittests |
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