From 8fd41630cebaf6ae6fe5455ab4b7918c33595aab Mon Sep 17 00:00:00 2001 From: Kevin Lingerfelt Date: Tue, 22 May 2018 19:01:44 -0700 Subject: [PATCH] Don't re-run yarn install as pre-req for build/run/test Signed-off-by: Kevin Lingerfelt --- .travis.yml | 2 +- BUILD.md | 6 ++---- bin/web | 10 +++------- web/Dockerfile | 2 +- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 534077558f6a2..4858b1d9bcd31 100644 --- a/.travis.yml +++ b/.travis.yml @@ -60,7 +60,7 @@ jobs: - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.3.2 - export PATH="$HOME/.yarn/bin:$PATH" install: - - ./bin/web build + - ./bin/web script: - ./bin/web test --reporters dots diff --git a/BUILD.md b/BUILD.md index 14e4530d6a89c..434c5162b6499 100644 --- a/BUILD.md +++ b/BUILD.md @@ -259,8 +259,7 @@ address of the public API server that's running in your docker environment: ```bash docker-compose stop web -cd web -../bin/go-run . --api-addr=$DOCKER_IP:8085 +bin/web run --api-addr=$DOCKER_IP:8085 ``` #### 3. Connect to `public-api` in Kubernetes @@ -283,8 +282,7 @@ bin/web port-forward Then connect the local web process to the forwarded port: ```bash -cd web -../bin/go-run . --api-addr=localhost:8085 +bin/web run --api-addr=localhost:8085 ``` ### Webpack dev server diff --git a/bin/web b/bin/web index fdea915eacf09..c9ac9904cb7a2 100755 --- a/bin/web +++ b/bin/web @@ -24,7 +24,7 @@ USAGE }; function --help { -h ;} function dev { - setup + build while getopts "p:" opt; do case "$opt" in @@ -36,12 +36,10 @@ function dev { cd $ROOT/web/app && yarn webpack-dev-server --port $DEV_PORT & cd $ROOT/web && \ - ../bin/go-run . --webpack-dev-server=http://localhost:$DEV_PORT + ../bin/go-run . --webpack-dev-server=http://localhost:$DEV_PORT $* } function build { - setup - cd $ROOT/web/app yarn webpack } @@ -60,7 +58,7 @@ function run { port-forward & cd $ROOT/web - ../bin/go-run . + ../bin/go-run . $* } function setup { @@ -69,8 +67,6 @@ function setup { } function test { - setup - cd $ROOT/web/app yarn karma start --single-run $* } diff --git a/web/Dockerfile b/web/Dockerfile index 1693975335b78..2c6c6a6d7b085 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -21,7 +21,7 @@ RUN $ROOT/bin/web setup --pure-lockfile # set the env to production *after* yarn has done an install, to make sure all # libraries required for building are included. ENV NODE_ENV production -RUN yarn webpack +RUN $ROOT/bin/web build ## compile go server FROM gcr.io/runconduit/go-deps:69ba71ed as golang