@@ -19,7 +19,7 @@ repository and accessible at `../netrunner-cards-json` to the application.
19
19
20
20
This repository has a Devcontainer setup. To use it, first copy the database.yml file.
21
21
22
- ```
22
+ ``` sh
23
23
cp config/database.example.yml config/database.yml
24
24
```
25
25
@@ -30,28 +30,30 @@ If you open this folder in VS Code it should prompt you to use the devcontainer.
30
30
If you have a device with apple silicon, do the following first (adapt the
31
31
platform based on your device and error message):
32
32
33
- ```
33
+ ``` sh
34
34
export DOCKER_DEFAULT_PLATFORM=linux/arm64/v8
35
35
```
36
36
37
- ```
37
+ ``` sh
38
38
echo " RAILS_ENV=development" > .env
39
39
cp config/database.example.yml config/database.yml
40
40
docker network create null_signal
41
41
docker compose build
42
42
docker compose -f docker-compose.yml -f docker-compose.override.init.yml up -d
43
43
```
44
+
44
45
Wait until ` docker compose logs nrdb_api_server | tail ` shows ` Listening on http://0.0.0.0:3000 ` .
45
46
46
47
Test that ` http://localhost:3000/api/docs/ ` loads in your browser. Afterwords,
47
48
48
- ```
49
+ ``` sh
49
50
docker compose up -d
50
51
```
51
52
Is enough to spin up the containers, unless you want to restart the db from scratch (use the above example with init.yml)
52
53
53
54
To run tests in your docker container, you will need to override the environment, like so:
54
- ```
55
+
56
+ ``` sh
55
57
docker compose exec -e RAILS_ENV=test nrdb_api_server rails test
56
58
```
57
59
@@ -72,3 +74,24 @@ To re-generate API documentation (in test environment to ensure minimal changes)
72
74
```
73
75
docker compose run -e RAILS_ENV=test nrdb_api_server bundle exec rake docs:generate
74
76
```
77
+
78
+ ## Tasks
79
+
80
+ If you are using docker, ensure that you are in a shell for the container before running these tasks.
81
+
82
+ ### Importing Cards
83
+
84
+ To import cards from the ` netrunner-cards-json ` repository, first ensure that
85
+ it is checked out next to this directory, then run:
86
+
87
+ ``` sh
88
+ bundle exec rake cards:import
89
+ ```
90
+
91
+ ### Importing Decklists
92
+
93
+ To import decklists from NRDB Classic, use
94
+
95
+ ``` sh
96
+ bundle exec rake import_decklists:import[2024-11-09]
97
+ ```
0 commit comments