mirror of https://github.com/linkerd/linkerd2.git
Stop background processes on failure (#2478)
* Stop background processes on failure * Exit successfully * Move trap into dev only * Move install linkerd up * Fold dev into run
This commit is contained in:
parent
788d7c6dfa
commit
4eb89bb8c2
37
BUILD.md
37
BUILD.md
|
@ -247,12 +247,14 @@ These commands assume working [Go](https://golang.org) and
|
|||
|
||||
#### First time setup
|
||||
|
||||
Install [Yarn](https://yarnpkg.com) and use it to install dependencies:
|
||||
1. Install [Yarn](https://yarnpkg.com) and use it to install dependencies:
|
||||
|
||||
```bash
|
||||
brew install yarn
|
||||
bin/web setup
|
||||
```
|
||||
```bash
|
||||
brew install yarn
|
||||
bin/web setup
|
||||
```
|
||||
|
||||
1. Install Linkerd on a Kubernetes cluster.
|
||||
|
||||
#### Run web standalone
|
||||
|
||||
|
@ -264,13 +266,28 @@ The web server will be running on `localhost:8084`.
|
|||
|
||||
#### Webpack dev server
|
||||
|
||||
To develop with a webpack dev server, run:
|
||||
To develop with a webpack dev server:
|
||||
|
||||
```bash
|
||||
bin/web dev
|
||||
```
|
||||
1. Start the development server.
|
||||
|
||||
Note: you'll want to install Linkerd2 on a Kubernetes cluster first.
|
||||
```bash
|
||||
bin/web dev
|
||||
```
|
||||
|
||||
Note: this will start up:
|
||||
|
||||
- `web` on :8084. This is the golang process that serves the dashboard.
|
||||
- `webpack-dev-server` on :8080 to manage rebuilding/reloading of the
|
||||
javascript.
|
||||
- `controller` is port-forwarded from the Kubernetes cluster via `kubectl`
|
||||
on :8085
|
||||
- `grafana` is port-forwarded from the Kubernetes cluster via `kubectl`
|
||||
on :3000
|
||||
|
||||
1. Go to [http://localhost:8084](http://localhost:8084) to see everything
|
||||
running.
|
||||
|
||||
#### Dependencies
|
||||
|
||||
To add a JS dependency:
|
||||
|
||||
|
|
19
bin/web
19
bin/web
|
@ -40,22 +40,14 @@ function check-for-linkerd {
|
|||
}
|
||||
|
||||
function dev {
|
||||
build
|
||||
|
||||
while getopts "p:" opt; do
|
||||
case "$opt" in
|
||||
p) DEV_PORT=$OPTARG
|
||||
esac
|
||||
done
|
||||
|
||||
check-for-linkerd && (
|
||||
port-forward controller 8085 &
|
||||
port-forward grafana 3000 &
|
||||
)
|
||||
|
||||
cd $ROOT/web/app && yarn webpack-dev-server --port $DEV_PORT &
|
||||
cd $ROOT/web && \
|
||||
../bin/go-run . $*
|
||||
run
|
||||
}
|
||||
|
||||
function build {
|
||||
|
@ -86,6 +78,11 @@ function port-forward {
|
|||
}
|
||||
|
||||
function run {
|
||||
# Stop everything in the process group (in the background) whenever the
|
||||
# parent process experiences an error and exits.
|
||||
trap "exit" INT TERM
|
||||
trap "kill 0" EXIT
|
||||
|
||||
build
|
||||
|
||||
check-for-linkerd && (
|
||||
|
@ -93,8 +90,8 @@ function run {
|
|||
port-forward grafana 3000 &
|
||||
)
|
||||
|
||||
cd $ROOT/web
|
||||
../bin/go-run . $*
|
||||
cd $ROOT/web && \
|
||||
../bin/go-run . $*
|
||||
}
|
||||
|
||||
function setup {
|
||||
|
|
Loading…
Reference in New Issue