This little script was written to simlify our process with installing multiple directus extnsions in one instance while deploying a directus contaier to our kubernetes cluster.
It provides several diffrent methods to install the extensions from.
You can provide your extension list as *.json, string or use the helm values file for the Directus Helm Chart.
- Download your needed version from our latest release
- Place the dowloaded executable in a folder that is inside your
$PATH. e.g. on unix in/binoder/usr/bin.
Prerequisites
- git
- nodejs (with npm)
- place downloaded executable in a folder within your
$PATH
mv ~/Downloads/dei-mac /usr/local/bin/dei- make it executable
chmod +x /usr/local/bin/dei- allow the unsigned binary to be executed
spctl --add --label "DEI" /usr/local/bin/dei- (OPTIONAL) remove it from quarantine
xattr -d com.apple.quarantine /usr/local/bin/dei- place downloaded executable somewhere safe
e.g. create a folderC:\binand put it there. - Press
WIN-key +Rand entersysdm.cpland hitEnter. - Navigate to the tab
Advanced - Open
Environmentvariablesat the bottom - Double click on the
Path-variable - Click on
Newand enter the location of the directory where the executable is located
e.g.C:\bin
Required format:
[{
"name": "<extension_name>",
"git": "https://<git_url>",
"type": "<extension_type>",
"npm_install": true | false
}]directus-extension-installer <extensions-folder-path> -f extensions.jsondirectus-extension-installer <extensions-folder-path> --file extensions.jsonIt's basically a stringyfied version of the json-file contents.
directus-extension-installer <extensions-folder-path> -s '[{"name": "EXTENSION_NAME","git": "HTTPS_GIT_URL","type": "EXTENSION_TYPE", "npm_install": "true | false"}]'directus-extension-installer <extensions-folder-path> --string '[{"name": "EXTENSION_NAME","git": "HTTPS_GIT_URL","type": "EXTENSION_TYPE", "npm_install": "true | false"}]'more information about format: Directus Helm Chart
directus-extension-installer <extensions-folder-path> -y values.yamldirectus-extension-installer <extensions-folder-path> --yaml values.yamlname
should be a string that is complement with unix filesystem paths e.g. 'directus-extension'. This will be used as the extension name inside one of the extensions folders.
git
Should be a full https-git-url in order to clone the extension properly. Also if it is located inside of a private repository the url should include the authentication
type
should be one of the following: display, endpoint, hook, interface, layout, module, operation, panel or bundle. This places the extension inside the right extensions-subfolder.
npm_install
OPTIONAL! Defaults to false. When set tu true it will run thenpm installcommand inside the extension folder.