Skip to main content
Version: v4.5.0

Description

The stk-legacy add plugin command is used to add Plugins to the Stacks already created by the stk-legacy create stack command.

How does it work?

The command must be run inside a folder created by the stk-legacy create stack command. It can receive as a parameter an URL from a Plugin's Git repository or a path to a Plugin folder created by the stk-legacy create plugin command.

When using a URL from a Git repository, the Plugin will be added to the Stack as a submodule of this Stack. The Plugin has its own git repository. In this case, a single Plugin can be added to more than one Stack and updates are made to the Plugin's repository. These updates are automatically reflected in all Stacks where the Plugin has been added.

When using a path to a Plugin folder, the Plugin source code is copied into the Stack repository and becomes part of it as if it had been created directly in the Stack folder with the command stk-legacy create plugin. Using this option there is no way to reflect the Plugin update in more than one Stack.

Suggested change

Use this option if you want to convert a Plugin that was created as a submodule to a Plugin that won't be shared between Stacks.

You must run the commands below from in the Stack folder:

  • stk-legacy add plugin <plugin-repo-url> ou <path-to-the-plugin-folder> for each Plugin you want to add to the Stack.
  • git push -u origin main to update the Stack repository remotely after adding a Plugin.
info

You don't need to use the stk-legacy add plugin command if the Plugin has been created in the Stack folder.

Parameter

Check the available options in the command:

ParameterDescription
REPO_URL_OR_PATHSets Git's repository URL or the path to the Plugin folder you want to add to the Stack.

Example

After creating your Stack, you can add Plugins:

  1. Go to the Stack folder you created, in the example below the name is 'my-stack-demo':
cd my-stack-demo
  1. Then execute:
stk-legacy add plugin [URL of your repository or path to the plugin folder]
  1. The terminal returns:
> Verifying "[Your repository URL]" plugin git repository...
- Plugin repository is valid.
> Adding "[Your repository URL]" plugin to the stack...
- "[Your repository URL]" added to the stack.

Now you can execute 'git push' to publish the plugin added to remote stack repository.

4.Now, execute:

ls

5.The terminal returns:

stack.yaml
/name-repository-plugin
  1. Now run to update the remote Stack repository with the new Plugin:
git push

See an example below:

Read more

Was this page helpful?