Skip to content

Commit 6f09708

Browse files
Clarify seeding steps in the readme
1 parent 1703e61 commit 6f09708

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

v2/stacks/migration/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,26 @@ init: base-init
1010
# Add any stack specific helper targets here
1111

1212
.PHONY: seed-topic-api
13-
seed-topic-api:
13+
seed-topic-api: # Seed the topic API with the required topics for the migration job
1414
../../scripts/seed-topic-api.sh
1515

1616
.PHONY: seed-permissions-api
17-
seed-permissions-api:
17+
seed-permissions-api: # Seed the permissions API with the required permissions for the migration job
1818
../../scripts/seed-permissions-api.sh
1919

2020
.PHONY: up-with-seed
21-
up-with-seed:
21+
up-with-seed: ## Start the stack and seed the topic and permissions APIs
2222
$(MAKE) up
2323
$(MAKE) seed-topic-api
2424
$(MAKE) seed-permissions-api
2525

2626
.PHONY: remove-migration-collection
27-
remove-migration-collection:
27+
remove-migration-collection: # Remove the test migration collection from zebedee content store.
2828
rm $(zebedee_root)/zebedee/collections/$(MIGRATION_COLLECTION_NAME).json
2929
rm -r $(zebedee_root)/zebedee/collections/$(MIGRATION_COLLECTION_NAME)
3030

3131
.PHONY: reset
32-
reset:
32+
reset: # Reset the MongoDB databases and remove the test migration collection
3333
mongosh localhost:27017/migrations --file ../../provisioning/mongo/reset.js
3434
mongosh localhost:27017/datasets --file ../../provisioning/mongo/reset.js
3535
$(MAKE) remove-migration-collection

v2/stacks/migration/README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,27 @@ To run the stack:
2323

2424
This is required for the local docker build to work around a current issue with the volume paths not existing pre-build. Once this issue has been resolved, this step will no longer be necessary.
2525

26-
3. Build and start the stack:
26+
3. For most use cases, you will want to run the stack with dp-topic-api and dp-permissions-api database seeded.
2727

28-
```shell
29-
make up
30-
```
31-
32-
To run the stack with dp-topic-api and dp-permissions-api database seeded:
28+
To run the seeding you will need mongosh installed:
3329

34-
Follow the prerequsites for installing `mongosh` here - `https://github.com/ONSdigital/dp-topic-api/tree/develop/scripts`
30+
```sh
31+
brew install mongosh
32+
```
3533

36-
Run:
34+
To run the services with seeding, run:
3735

3836
```shell
3937
make up-with-seed
4038
```
4139

42-
This assumes that the locations of repositories on your system is in the same root as `dp-compose` or that you have an environment variable set for `$DP_REPO_DIR`
40+
This will start all the containers (including mongodb) and then run the seeding scripts.
41+
42+
The seeding scripts assume that the repositories on your system are in the same root as `dp-compose` or that you have an environment variable set for `$DP_REPO_DIR`.
4343

4444
If that is not the correct location, you will be prompted to input a custom location for dp-topic-api or dp-permissions-api on your system.
4545

46-
Once the correct location is found, you should see something like:
46+
When the scripts run, you should see something like the below in your terminal:
4747

4848
```shell
4949
Found dp-topic-api at {some-path}/dp-topic-api
@@ -54,6 +54,14 @@ Seeding permissions API database...
5454
Found dp-permissions-api at {some-path}/dp-permissions-api
5555
```
5656

57+
If any service hasn't picked up it's topic or permissions cache, you can force a refresh via `SERVICE={serviceName} make restart`.
58+
59+
3a. If you don't want to run the stack with the databases seeded, you can use:
60+
61+
```sh
62+
make up
63+
```
64+
5765
## How to test it's all working together
5866

5967
1. Access the authentication stub login page <http://localhost:29500/florence/login>

0 commit comments

Comments
 (0)