From a064515684a7b6e13f4eb918a020413e14b1619f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 15 Jun 2020 16:43:36 +0200 Subject: [PATCH] chore(catalog-backend): split apart example components and register in loop --- .../examples/artist-lookup-component.yaml | 9 +++ .../examples/example-components.yaml | 60 ------------------- .../examples/example-location.yaml | 8 --- .../examples/playback-order-component.yaml | 9 +++ .../examples/podcast-api-component.yaml | 9 +++ .../examples/queue-proxy-component.yaml | 9 +++ .../examples/searcher-component.yaml | 9 +++ .../examples/shuffle-api-component.yaml | 9 +++ plugins/catalog-backend/scripts/mock-data | 25 +++++--- 9 files changed, 70 insertions(+), 77 deletions(-) create mode 100644 plugins/catalog-backend/examples/artist-lookup-component.yaml delete mode 100644 plugins/catalog-backend/examples/example-components.yaml delete mode 100644 plugins/catalog-backend/examples/example-location.yaml create mode 100644 plugins/catalog-backend/examples/playback-order-component.yaml create mode 100644 plugins/catalog-backend/examples/podcast-api-component.yaml create mode 100644 plugins/catalog-backend/examples/queue-proxy-component.yaml create mode 100644 plugins/catalog-backend/examples/searcher-component.yaml create mode 100644 plugins/catalog-backend/examples/shuffle-api-component.yaml diff --git a/plugins/catalog-backend/examples/artist-lookup-component.yaml b/plugins/catalog-backend/examples/artist-lookup-component.yaml new file mode 100644 index 0000000000..5fbb073c1a --- /dev/null +++ b/plugins/catalog-backend/examples/artist-lookup-component.yaml @@ -0,0 +1,9 @@ +apiVersion: backstage.io/v1beta1 +kind: Component +metadata: + name: artist-lookup + description: Artist Lookup +spec: + type: service + lifecycle: experimental + owner: tools@example.com diff --git a/plugins/catalog-backend/examples/example-components.yaml b/plugins/catalog-backend/examples/example-components.yaml deleted file mode 100644 index 4580fa7179..0000000000 --- a/plugins/catalog-backend/examples/example-components.yaml +++ /dev/null @@ -1,60 +0,0 @@ ---- -apiVersion: backstage.io/v1beta1 -kind: Component -metadata: - name: podcast-api - description: Podcast API -spec: - type: service - lifecycle: experimental - owner: tools@example.com ---- -apiVersion: backstage.io/v1beta1 -kind: Component -metadata: - name: artist-lookup - description: Artist Lookup -spec: - type: service - lifecycle: experimental - owner: tools@example.com ---- -apiVersion: backstage.io/v1beta1 -kind: Component -metadata: - name: searcher - description: Searcher -spec: - type: service - lifecycle: production - owner: tools@example.com ---- -apiVersion: backstage.io/v1beta1 -kind: Component -metadata: - name: playback-order - description: Playback Order -spec: - type: service - lifecycle: production - owner: tools@example.com ---- -apiVersion: backstage.io/v1beta1 -kind: Component -metadata: - name: shuffle-api - description: Shuffle API -spec: - type: service - lifecycle: production - owner: tools@example.com ---- -apiVersion: backstage.io/v1beta1 -kind: Component -metadata: - name: queue-proxy - description: Queue Proxy -spec: - type: website - lifecycle: production - owner: tools@example.com diff --git a/plugins/catalog-backend/examples/example-location.yaml b/plugins/catalog-backend/examples/example-location.yaml deleted file mode 100644 index 5c507b29b5..0000000000 --- a/plugins/catalog-backend/examples/example-location.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -apiVersion: backstage.io/v1beta1 -kind: Location -metadata: - name: location-1 -spec: - type: github - target: https://github.com/spotify/backstage/blob/master/plugins/catalog-backend/examples/example-components.yaml diff --git a/plugins/catalog-backend/examples/playback-order-component.yaml b/plugins/catalog-backend/examples/playback-order-component.yaml new file mode 100644 index 0000000000..4ee959f48f --- /dev/null +++ b/plugins/catalog-backend/examples/playback-order-component.yaml @@ -0,0 +1,9 @@ +apiVersion: backstage.io/v1beta1 +kind: Component +metadata: + name: playback-order + description: Playback Order +spec: + type: service + lifecycle: production + owner: tools@example.com diff --git a/plugins/catalog-backend/examples/podcast-api-component.yaml b/plugins/catalog-backend/examples/podcast-api-component.yaml new file mode 100644 index 0000000000..c2c7ee34dd --- /dev/null +++ b/plugins/catalog-backend/examples/podcast-api-component.yaml @@ -0,0 +1,9 @@ +apiVersion: backstage.io/v1beta1 +kind: Component +metadata: + name: podcast-api + description: Podcast API +spec: + type: service + lifecycle: experimental + owner: tools@example.com diff --git a/plugins/catalog-backend/examples/queue-proxy-component.yaml b/plugins/catalog-backend/examples/queue-proxy-component.yaml new file mode 100644 index 0000000000..8298b19f93 --- /dev/null +++ b/plugins/catalog-backend/examples/queue-proxy-component.yaml @@ -0,0 +1,9 @@ +apiVersion: backstage.io/v1beta1 +kind: Component +metadata: + name: queue-proxy + description: Queue Proxy +spec: + type: website + lifecycle: production + owner: tools@example.com diff --git a/plugins/catalog-backend/examples/searcher-component.yaml b/plugins/catalog-backend/examples/searcher-component.yaml new file mode 100644 index 0000000000..ecfd92f470 --- /dev/null +++ b/plugins/catalog-backend/examples/searcher-component.yaml @@ -0,0 +1,9 @@ +apiVersion: backstage.io/v1beta1 +kind: Component +metadata: + name: searcher + description: Searcher +spec: + type: service + lifecycle: production + owner: tools@example.com diff --git a/plugins/catalog-backend/examples/shuffle-api-component.yaml b/plugins/catalog-backend/examples/shuffle-api-component.yaml new file mode 100644 index 0000000000..d45a06e030 --- /dev/null +++ b/plugins/catalog-backend/examples/shuffle-api-component.yaml @@ -0,0 +1,9 @@ +apiVersion: backstage.io/v1beta1 +kind: Component +metadata: + name: shuffle-api + description: Shuffle API +spec: + type: service + lifecycle: production + owner: tools@example.com diff --git a/plugins/catalog-backend/scripts/mock-data b/plugins/catalog-backend/scripts/mock-data index c9e4e35d7b..a21a60fcf3 100755 --- a/plugins/catalog-backend/scripts/mock-data +++ b/plugins/catalog-backend/scripts/mock-data @@ -1,9 +1,16 @@ -#!/usr/bin/env sh -curl \ ---location \ ---request POST 'localhost:7000/catalog/locations' \ ---header 'Content-Type: application/json' \ ---data-raw '{ - "type": "github", - "target": "https://github.com/spotify/backstage/blob/master/plugins/catalog-backend/examples/example-components.yaml" -}' +#!/usr/bin/env bash + +for URL in \ + 'artist-lookup-component.yaml' \ + 'playback-order-component.yaml' \ + 'podcast-api-component.yaml' \ + 'queue-proxy-component.yaml' \ + 'searcher-component.yaml' \ + 'shuffle-api-component.yaml' \ +; do \ + curl \ + --location \ + --request POST 'localhost:7000/catalog/locations' \ + --header 'Content-Type: application/json' \ + --data-raw "{\"type\": \"github\", \"target\": \"https://github.com/spotify/backstage/blob/master/plugins/catalog-backend/examples/${URL}\"}" +done