From 7936a0643d5785fd0001d6f2d2ac940112576c72 Mon Sep 17 00:00:00 2001 From: Bilawal Hameed Date: Mon, 3 Feb 2020 15:17:28 +0100 Subject: [PATCH] Add docs and enable cookiecutter to support other templates --- README.md | 10 ++++++++++ tools/cookiecutter/Dockerfile | 2 -- tools/cookiecutter/init.sh | 10 ++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100755 tools/cookiecutter/init.sh diff --git a/README.md b/README.md index 384cb54b65..ef5b88b0d6 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,16 @@ Backstage is an open platform for building developer portals. ## Getting started +## Plugins + +### Creating a Plugin + +Run the following: + +```terminal +$ ./tools/cookiecutter/init.sh frontend/packages/plugins/_template --output-dir frontend/packages/plugins +``` + ## Documentation ## License diff --git a/tools/cookiecutter/Dockerfile b/tools/cookiecutter/Dockerfile index f9a1629247..9affb40d0f 100644 --- a/tools/cookiecutter/Dockerfile +++ b/tools/cookiecutter/Dockerfile @@ -1,5 +1,3 @@ FROM python:3.8-slim - RUN pip install cookiecutter==1.7.0 --index-url https://pypi.python.org/simple - ENTRYPOINT [ "cookiecutter" ] \ No newline at end of file diff --git a/tools/cookiecutter/init.sh b/tools/cookiecutter/init.sh new file mode 100755 index 0000000000..717ab50cd3 --- /dev/null +++ b/tools/cookiecutter/init.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -e + +# Build the container +docker build $(pwd)/tools/cookiecutter -t backstage/tools/cookiecutter --quiet + +# Run cookiecutter with our arguments +COOKIECUTTER_FLAGS=${@:-""} +docker run -it -v $(pwd):/app -w /app backstage/tools/cookiecutter $COOKIECUTTER_FLAGS