From 8f0c4638053807923025fe3ae1b7c2ab78ebba9e Mon Sep 17 00:00:00 2001 From: Yuryshev Date: Wed, 20 Mar 2019 15:24:01 +0300 Subject: [PATCH] Changes: 1. Added pairs of run-goals: - `run`, `docker-run` - `run-daemon`, `docker-run-daemon` - starts in "detached" state 2. Removed goals: `make refresh`, `make docker-refresh` 3. Edited README.md accordingly to changes --- Makefile | 15 +++++++-------- README.md | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 02541ab512..f63a39ceda 100644 --- a/Makefile +++ b/Makefile @@ -56,7 +56,6 @@ bin: ${OPTS} go build -o ./therealssh-cli ./cmd/therealssh-cli # Dockerized skywire-node - docker-image: docker image build --tag=skywire-runner --rm - < skywire-runner.Dockerfile @@ -78,28 +77,28 @@ docker-apps: docker-bin: ${DOCKER_OPTS} go build -o ./node/skywire-node ./cmd/skywire-node - docker-volume: docker-apps docker-bin bin ./skywire-cli config ./node/skywire.json docker-run: docker-clean docker-image docker-network docker-volume + docker run -it -v $(shell pwd)/node:/sky --network=${DOCKER_NETWORK} \ + --name=${DOCKER_NODE} ${DOCKER_IMAGE} bash -c "cd /sky && ./skywire-node" + +docker-run-daemon: docker-clean docker-image docker-network docker-volume docker run -d -v $(shell pwd)/node:/sky --network=${DOCKER_NETWORK} \ --name=${DOCKER_NODE} ${DOCKER_IMAGE} bash -c "cd /sky && ./skywire-node" docker-stop: -docker container stop ${DOCKER_NODE} -docker-refresh: docker-stop docker-bin - docker container start ${DOCKER_NODE} # skywire-node on host - run: stop build + ./skywire-node + +run-daemon: stop build ./skywire-node &>/dev/null & stop: -bash -c "kill $$(ps aux |grep '[s]kywire-node' |awk '{print $$2}')" -refresh: stop - ${OPTS} go build -o ./skywire-node ./cmd/skywire-node - ./skywire-node &>/dev/null & \ No newline at end of file diff --git a/README.md b/README.md index c37b928a05..ec5d7ca02e 100644 --- a/README.md +++ b/README.md @@ -364,7 +364,7 @@ Idea of test from Erlang classics: https://youtu.be/uKfKtXYLG78?t=120 ```bash # Setup: run skywire-nodes on host and in docker -$ make docker-run && make run +$ make docker-run-daemon && make run-daemon # Open in browser chat application $ firefox http://$SW_NODE_B:8000 & # add transport