Update ui-v2 makefile to handle updating node_modules when needed
Also dont include the dist and node_modules folders in the build context.
This commit is contained in:
parent
2d863b8d4c
commit
5c9275c60b
|
@ -11,4 +11,4 @@ RUN apk update && \
|
|||
mkdir /consul-src
|
||||
|
||||
WORKDIR /consul-src
|
||||
CMD make init build
|
||||
CMD make
|
||||
|
|
|
@ -68,7 +68,7 @@ function build_ui {
|
|||
then
|
||||
status "Copying the source from '${ui_dir}' to /consul-src within the container"
|
||||
(
|
||||
docker cp . ${container_id}:/consul-src &&
|
||||
tar -c $(ls | grep -v "^(node_modules\|dist)") | docker cp - ${container_id}:/consul-src &&
|
||||
status "Running build in container" && docker start -i ${container_id} &&
|
||||
rm -rf ${1}/ui-v2/dist &&
|
||||
status "Copying back artifacts" && docker cp ${container_id}:/consul-src/dist ${1}/ui-v2/dist
|
||||
|
|
|
@ -1,33 +1,28 @@
|
|||
ROOT:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
server:
|
||||
all: build
|
||||
|
||||
deps: node_modules
|
||||
|
||||
build: deps
|
||||
yarn run build
|
||||
|
||||
start: deps
|
||||
yarn run start
|
||||
|
||||
dist:
|
||||
yarn run build
|
||||
mv dist ../pkg/web_ui/v2
|
||||
test: deps
|
||||
yarn run test
|
||||
|
||||
init:
|
||||
yarn install
|
||||
test-view: deps
|
||||
yarn run test:view
|
||||
|
||||
lint:
|
||||
lint: deps
|
||||
yarn run lint:js
|
||||
format:
|
||||
|
||||
format: deps
|
||||
yarn run format:js
|
||||
|
||||
.PHONY: server dist lint format
|
||||
node_modules: yarn.lock package.json
|
||||
yarn install
|
||||
|
||||
.DEFAULT_GOAL=all
|
||||
.PHONY: deps test all build start
|
||||
all: deps
|
||||
deps: node_modules yarn.lock package.json
|
||||
node_modules:
|
||||
yarn
|
||||
build:
|
||||
yarn run build
|
||||
start:
|
||||
yarn run start
|
||||
test:
|
||||
yarn run test
|
||||
test-view:
|
||||
yarn run test:view
|
||||
.PHONY: all deps build start test test-view lint format
|
||||
|
|
Loading…
Reference in New Issue