In addition to the custom commands, it is possible to extend fin further with addons per project or per host. Addons are community submitted commands and can be found in the Docksal Addons Repository. In order to use addons, fin version 1.7.0 or higher is required.
Installing an addon can be as simple executing the addon
command within the project that the addon should be added for.
fin addon install <name>
Fin will first look for the addon in the ~/.docksal/addons
directory. If it is not located there, then it will attempt to search the Docksal Addons Repository.
To remove an addon run:
fin addon remove <name>
Here is a list of already created addons that can help extend functionality for your project.
Name | Description | Requirements |
---|---|---|
example | A working documentation on what is Docksal addon and how it works | |
adminer | Adminer database management tool | MySQL |
codeclimate | CodeClimate code quality tool | |
mailhog | Mailhog e-mail capture service for current project | |
phpunit | Creates a phpunit.xml file and runs PHPUnit tests | Drupal |
pma | PhpMyAdmin database management tool | MySQL |
redis | Add Redis to current project | |
sequelpro | Launches SequelPro with the connection information for current project. | macOS |
solr | Apache Solr search service for current project | |
uli | Generate one time login url for current site | Drupal |
NOTE: This list may not be up to date. To see a more comprehensive list consult the Docksal Addons Repository.
To create an addon the following example can be followed.
Other than that, the bare minimum is necessary.
example
, my folder structure would look like example/example
.#!/usr/bin/env bash
VERSION="1.0"
## Example addon
##
## This is an example addon. It's purpose is to show sample folder structure
## and concepts of creating addons.
##
## fin example <command>
##
## Usage:
## hello Say Hello!
## version Display addon version
case "$1" in
hello)
echo "Hello!"
;;
version|-v)
echo "$VERSION"
;;
*)
fin help example
;;
esac
.filelist
at the end of it. For example, if the addon’s name was example
, the file name would be example/example.filelist
. This file will contain any additional files within the addon folder that should be included at the time of install.# If you want to include more than a single script file,
# you do it by creating addon.filelist file
# where all additional files should be described.
# One line per file, paths relative to current folder.
# Here is additional files
some-additional-files/somefile
# If you want to use hooks they should also be included here
# or they won't get downloaded and executed
example.pre-install
example.post-install
example.pre-uninstall
example.post-uninstall
When adding or removing an addon, it can contain a set of pre and post commands that will be executed. Example use cases would be to add/remove a service to the projects docksal.yml
. Each use case will vary but they are available for use if necessary. For instance, an addon named example
that needs to execute a process before it is installed would be be located in the file named example/example.pre-install
. This file should also be included within the example/example.filelist
file as noted above.
Phase | Process | File Extension |
---|---|---|
Before | Install | .pre-install |
After | Install | .post-install |
Before | Uninstall | .pre-uninstall |
After | Uninstall | .post-install |