Skip to content

Commit

Permalink
Don't re-run yarn install as pre-req for build/run/test
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Lingerfelt <kl@buoyant.io>
  • Loading branch information
klingerf committed May 23, 2018
1 parent 78f46c6 commit 8fd4163
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 2 additions & 4 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 3 additions & 7 deletions bin/web
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ USAGE
}; function --help { -h ;}

function dev {
setup
build

while getopts "p:" opt; do
case "$opt" in
Expand All @@ -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
}
Expand All @@ -60,7 +58,7 @@ function run {
port-forward &

cd $ROOT/web
../bin/go-run .
../bin/go-run . $*
}

function setup {
Expand All @@ -69,8 +67,6 @@ function setup {
}

function test {
setup

cd $ROOT/web/app
yarn karma start --single-run $*
}
Expand Down
2 changes: 1 addition & 1 deletion web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8fd4163

Please sign in to comment.