From 503875dde3d5d777a43b60afa0d6befd8960ddee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 26 May 2020 08:10:13 +0200 Subject: [PATCH 1/3] Update README.md --- packages/backend/README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/backend/README.md b/packages/backend/README.md index 1246be60bc..6d72e1c29c 100644 --- a/packages/backend/README.md +++ b/packages/backend/README.md @@ -12,7 +12,17 @@ app. Until then, feel free to experiment here! ## Development -To run the backend in watch mode, use `yarn start`. +To run the example backend in watch mode, use + +```bash +AUTH_GOOGLE_CLIENT_ID=x AUTH_GOOGLE_CLIENT_SECRET=x SENTRY_TOKEN=x yarn start +``` + +in the backend directory. Substitute `x` for actual values, or leave them as +dummy values just to try out the backend without using the auth or sentry features. + +You may have to issue a `yarn build` command in the project root before doing +this for the first time. ## Documentation From 253fe63cd59de669b2e5501f43933406671abd4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 26 May 2020 08:23:47 +0200 Subject: [PATCH 2/3] Add catalog population info too --- packages/backend/README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/packages/backend/README.md b/packages/backend/README.md index 6d72e1c29c..3745da280f 100644 --- a/packages/backend/README.md +++ b/packages/backend/README.md @@ -24,6 +24,31 @@ dummy values just to try out the backend without using the auth or sentry featur You may have to issue a `yarn build` command in the project root before doing this for the first time. +The backend starts up on port 7000 per default. + +## Populating The Catalog + +If you want to use the catalog functionality, you need to add so called locations +to the backend. These are places where the backend can find some entity descriptor +data to consume and serve. + +To get started, you can issue the following after starting the backend: + +```bash +curl -i \ + -H "Content-Type: application/json" + -d '{"type":"github","target":"https://github.com/spotify/backstage/blob/master/plugins/catalog-backend/fixtures/two_components.yaml"}' \ + localhost:7000/catalog/locations +``` + +After a short while, you should start seeing data on `localhost:7000/catalog/entities`. + +If you changed the `type` to `file` in the command above, and set the `target` +to the absolute path of a YAML file on disk, you could consume your own experimental data. + +The catalog currently runs in-memory only, so feel free to try it out, but it will +need to be re-populated on next startup. + ## Documentation - [Backstage Readme](https://github.com/spotify/backstage/blob/master/README.md) From 0fc794f73796b18ce8b9edb4615ee4f9715d944c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 26 May 2020 09:05:45 +0200 Subject: [PATCH 3/3] Fix review comments --- packages/backend/README.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/backend/README.md b/packages/backend/README.md index 3745da280f..d1cc8b99b7 100644 --- a/packages/backend/README.md +++ b/packages/backend/README.md @@ -12,18 +12,24 @@ app. Until then, feel free to experiment here! ## Development -To run the example backend in watch mode, use +To run the example backend, first go to the project root and run + +```bash +yarn install +yarn build +``` + +You should only need to do this once. + +After that, go to the `packages/backend` directory and run ```bash AUTH_GOOGLE_CLIENT_ID=x AUTH_GOOGLE_CLIENT_SECRET=x SENTRY_TOKEN=x yarn start ``` -in the backend directory. Substitute `x` for actual values, or leave them as +Substitute `x` for actual values, or leave them as dummy values just to try out the backend without using the auth or sentry features. -You may have to issue a `yarn build` command in the project root before doing -this for the first time. - The backend starts up on port 7000 per default. ## Populating The Catalog @@ -36,7 +42,7 @@ To get started, you can issue the following after starting the backend: ```bash curl -i \ - -H "Content-Type: application/json" + -H "Content-Type: application/json" \ -d '{"type":"github","target":"https://github.com/spotify/backstage/blob/master/plugins/catalog-backend/fixtures/two_components.yaml"}' \ localhost:7000/catalog/locations ```