From 3b1e0a07797b0888eff7601dff4d04d37364da1e Mon Sep 17 00:00:00 2001 From: Justin Drew <2396364+jdrew82@users.noreply.github.com> Date: Tue, 10 Sep 2024 14:57:43 -0500 Subject: [PATCH] =?UTF-8?q?docs:=20=F0=9F=93=9D=20Update=20documentation?= =?UTF-8?q?=20to=20reference=20how=20to=20install=20an=20App=20from=20PyPI?= =?UTF-8?q?=20or=20in=20plugins=20folder.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/plugins.md | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/docs/plugins.md b/docs/plugins.md index 686e062bd..15a194a0d 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -1,9 +1,11 @@ # App Installation -To add Apps you will need to build a custom container with the App(s) installed. There are multiple ways to add an App to your environment but this document will show the standard method pulling from PyPI. +To add Apps you will need to build a custom container with the App(s) installed. There are multiple ways to add an App to your environment but this document will describe two options, the first is the [standard method pulling from PyPI](#adding-apps-using-pypi) and the second will be to [using the `plugins` folder](#adding-apps-using-plugins-folder). ## Getting Started Using Apps +### Adding Apps using PyPI + 1. Follow the steps in the README to create your Poetry environment and ensure you can build a container. 2. There are two methods by which to add a specific App to your environment with Poetry: @@ -43,6 +45,28 @@ invoke build --no-cache invoke stop start ``` +### Adding Apps Using Plugins Folder + +In addition to adding Apps via PyPI, you can add Apps into your instance by having the code in the `plugins` folder. As long as the App folder contains a `pyproject.toml` file you can add the App with the following methods: + +#### Reference App in pyproject.toml + +You can point to the App folder in the project `pyproject.toml` like so: + +`nautobot-example-plugin = {path = "plugins/plugin_example"}` + +### Install App from Wheel + +The other option to install an App would be to uncomment the section of the Dockerfile that starts at line 37: + +```text +# RUN for plugin in /source/plugins/*; do \ +# cd $plugin && \ +# poetry build && \ +# cp dist/*.whl /tmp/dist; \ +# done +``` + ## Nautobot Configuration The configuration file is the same file that is used by the Dockerfile in the Nautobot repo. This file should be updated to match what is required for each of the Apps. An example update for the Onboarding App looks like: