Skip to content

Commit 092e343

Browse files
committed
doc: update readme docker instructions with scripts
1 parent 30c85cb commit 092e343

File tree

2 files changed

+13
-23
lines changed

2 files changed

+13
-23
lines changed

README.md

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -68,44 +68,34 @@ and open [http://localhost:1042/](http://localhost:1042/).
6868

6969
### Using Docker
7070

71-
You'll need to install [Docker](https://docs.docker.com/get-docker/) and [Docker-Compose](https://docs.docker.com/compose/install/). After that, just run `$ docker-compose up --build` in the project directory (or do the GUI-equivalent of this). If this fails because it "couldn't fetch dependencies", try again, it was just a networking error.
71+
You'll need to install [Docker](https://docs.docker.com/get-docker/) and [Docker-Compose](https://docs.docker.com/compose/install/). After that, just run `bin/up` in the project directory (or do the GUI-equivalent of this). If this fails because it "couldn't fetch dependencies", try again, it was just a networking error.
7272

7373
It can take a while. You'll see lots of messages, so just wait until you see something like `netrunner-server-1 | nREPL server started on port 44867`. After that, you can visit [http://localhost:1042/](http://localhost:1042/) and the server should be running.
7474

75-
While coding clojure it's important to have a REPL connection going. The server's REPL is configured to always run on port `44867`, so you can connect using `$ lein repl :connect nrepl://localhost:44867` (or the program of your preference, like your code editor).
75+
While coding clojure it's important to have a REPL connection going. The server's REPL is configured to always run on port `44867`, so you can connect using `$ bin/repl` (or the program of your preference, like your code editor).
7676

77-
Now, let's populate the database and create indexes. First, let's open a terminal inside the server container: `$ docker exec -it netrunner-server-1 /bin/bash`. Now, inside this new therminal, we'll run these two commands: *The `--no-card-images` is optional, and removing it causes the card images to be downloaded, which can be slower.*
77+
Now, let's populate the database and create indexes with `bin/database-seed`. This will download card images, which can be slow. When its done the server will be restarted. If you ever need to drop the database, run `bin/database-drop`. This will keep the card images you downloaded previously, but you'll need to do `bin/up` and `bin/database-seed` again.
7878

79-
```
80-
$ lein fetch --no-card-images
81-
1648 cards imported
82-
83-
$ lein create-indexes
84-
Indexes successfully created.
85-
```
79+
You can access the servers' bash and lein commands individually using `bin/bash` and `bin/lein`.
8680

87-
After this, just restart the server by running `(restart)` in the REPL.
88-
89-
To do testing, you run them inside the container: `$ docker exec -it netrunner-server-1 /bin/bash` and then `$ lein kaocha`.
9081
### Tests
9182

83+
To do testing, you run them inside the container with `bin/test` and `bin/test-focus`.
84+
9285
To run all tests:
9386

94-
$ lein kaocha
95-
Ran 2640 tests containing 44704 assertions.
96-
0 failures, 0 errors.
87+
$ bin/test
88+
3602 tests, 118797 assertions, 0 failures.
9789

9890
To run a single test file:
9991

100-
$ lein kaocha --focus game.cards.agendas-test
101-
Ran 216 tests containing 3536 assertions.
102-
0 failures, 0 errors.
92+
$ bin/test-focus game.cards.agendas-test
93+
285 tests, 9715 assertions, 0 failures.
10394

10495
Or a single test:
10596

106-
$ lein kaocha --focus game.cards.agendas-test/fifteen-minutes
107-
Ran 1 tests containing 29 assertions.
108-
0 failures, 0 errors.
97+
$ bin/test-focus game.cards.agendas-test/fifteen-minutes
98+
1 tests, 47 assertions, 0 failures.
10999

110100
For more information refer to the [development guide](https://github.com/mtgred/netrunner/wiki/Getting-Started-with-Development).
111101

bin/up

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env sh
22

3-
docker-compose up --build
3+
docker-compose up

0 commit comments

Comments
 (0)