forked from p15670423/monkey
Build: Run `npm run dev` on development build
This commit is contained in:
parent
5bed5b7d7c
commit
27d47c05c4
|
@ -28,6 +28,7 @@ setup_build_dir() {
|
|||
local agent_binary_dir=$1
|
||||
local monkey_repo=$2
|
||||
local deployment_type=$3
|
||||
local is_release_build=$4
|
||||
|
||||
pushd $APPIMAGE_DIR
|
||||
|
||||
|
@ -44,7 +45,7 @@ setup_build_dir() {
|
|||
install_mongodb
|
||||
|
||||
generate_ssl_cert "$BUILD_DIR"
|
||||
build_frontend "$BUILD_DIR"
|
||||
build_frontend "$BUILD_DIR" "$is_release_build"
|
||||
|
||||
remove_python_appdir_artifacts
|
||||
|
||||
|
|
|
@ -196,8 +196,13 @@ fi
|
|||
install_build_prereqs
|
||||
install_package_specific_build_prereqs "$WORKSPACE"
|
||||
|
||||
is_release_build=false
|
||||
# Monkey version is empty on release build
|
||||
if [ ! -z "$monkey_version" ]; then
|
||||
is_release_build=true
|
||||
fi
|
||||
|
||||
setup_build_dir "$agent_binary_dir" "$monkey_repo" "$deployment_type"
|
||||
setup_build_dir "$agent_binary_dir" "$monkey_repo" "$deployment_type" "$is_release_build"
|
||||
commit_id=$(get_commit_id "$monkey_repo")
|
||||
build_package "$monkey_version" "$commit_id" "$DIST_DIR"
|
||||
|
||||
|
|
|
@ -74,11 +74,18 @@ generate_ssl_cert() {
|
|||
|
||||
build_frontend() {
|
||||
local ui_dir="$1/monkey_island/cc/ui"
|
||||
local is_release_build=$2
|
||||
pushd "$ui_dir" || handle_error
|
||||
|
||||
log_message "Generating front end"
|
||||
npm ci
|
||||
npm run dist
|
||||
if [ "$is_release_build" == true ]; then
|
||||
log_message "Running production front end build"
|
||||
npm run dist
|
||||
else
|
||||
log_message "Running development front end build"
|
||||
npm run dev
|
||||
fi
|
||||
|
||||
popd || handle_error
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ install_package_specific_build_prereqs() {
|
|||
setup_build_dir() {
|
||||
local agent_binary_dir=$1
|
||||
local monkey_repo=$2
|
||||
local is_release_build=$4
|
||||
local build_dir=$DOCKER_DIR/monkey
|
||||
|
||||
mkdir "$build_dir"
|
||||
|
@ -22,7 +23,7 @@ setup_build_dir() {
|
|||
|
||||
generate_ssl_cert "$build_dir"
|
||||
|
||||
build_frontend "$build_dir"
|
||||
build_frontend "$build_dir" "$is_release_build"
|
||||
}
|
||||
|
||||
copy_entrypoint_to_build_dir() {
|
||||
|
|
Loading…
Reference in New Issue