Skip to content

Commit 5f3422f

Browse files
authored
Automate plugin installation (#43)
* Add url parameter to plugin config * Update docs with more plugin install instructions * Update modified date --------- Signed-off-by: Mostafa Moradian <mostafa@gatewayd.io>
1 parent eb2c23d commit 5f3422f

File tree

7 files changed

+65
-27
lines changed

7 files changed

+65
-27
lines changed

getting-started/installation.md

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
last_modified_date: 2024-01-16 20:49:17 +0100
2+
last_modified_date: 2024-01-29 21:30:54 +0100
33
layout: default
44
title: Installation
55
description: How to install GatewayD and its plugins on different platforms and how to build it from source.
@@ -95,9 +95,26 @@ docker-compose up -d
9595

9696
## Installing plugins
9797

98-
Plugins are available as standalone binaries for different platforms. These binaries are available in their GitHub repositories.
98+
Plugins are available as standalone binaries for different platforms. These binaries are available in their GitHub repositories and are distributed as archives that contain the binary and the default configuration file for the plugin. The README file and the LICENSE file might also be included in the archive.
9999

100-
The plugins can be installed by using the `plugin` subcommand of `gatewayd`:
100+
There are currently four ways to install plugins using the `gatewayd plugin install` subcommand:
101+
102+
1. Providing the plugins configuration file with the plugins' URLs and versions.
103+
2. Using the GitHub URL of the plugin plus the version.
104+
3. Using the already downloaded archive of the plugin.
105+
4. Manually downloading, extracting and placing the plugins' binaries in your desired location and updating the plugins configuration file.
106+
107+
### 1. Using the plugins configuration file
108+
109+
In the `gatewayd_plugins.yaml` configuration file, you can specify the URLs and versions of the plugins that you want to install. The `gatewayd plugin install` subcommand will download the archives of the plugins from the specified URLs and extract them to the `plugins` directory in the current working directory and will also update the `gatewayd_plugins.yaml` configuration file.
110+
111+
```bash
112+
gatewayd plugin install
113+
```
114+
115+
### 2. Using the GitHub URL of the plugin plus the version
116+
117+
You can also install plugins using the GitHub URL of the plugin plus the version. The `gatewayd plugin install` subcommand will download the archive of the plugin from the specified URL and extract it to the `plugins` directory in the current working directory.
101118

102119
```bash
103120
gatewayd plugin install github.com/<organization>/<plugin-name>@<version>
@@ -109,9 +126,25 @@ For example, to install the `gatewayd-plugin-cache` plugin:
109126
gatewayd plugin install github.com/gatewayd-io/gatewayd-plugin-cache@latest
110127
```
111128

112-
The plugin binary will be installed in the `plugins` directory in the current working directory. For more flags, please refer to the [CLI](/using-gatewayd/CLI) page or just run `gatewayd plugin install --help`.
129+
You can also specify that you want to pull only and you don't want to extract the archive of the plugin.
130+
131+
```bash
132+
gatewayd plugin install --pull-only github.com/gatewayd-io/gatewayd-plugin-cache@latest
133+
```
134+
135+
### 3. Using the already downloaded archive of the plugin
136+
137+
You can also install plugins using the already downloaded archive of the plugin or using the `--pull-only` flag explained above. The `gatewayd plugin install` subcommand will extract the archive of the plugin to the `plugins` directory in the current working directory. The `--name` flag is mandatory when using this method and it must be the same as the name of the plugin.
138+
139+
```bash
140+
gatewayd plugin install --name <plugin-name> <path-to-archive>
141+
```
142+
143+
### 4. Manually downloading, extracting and placing the plugins' binaries in your desired location
144+
145+
You can manually download, extract and place the plugins' binaries in your desired location that is accessible to GatewayD via the plugins configuration file, aka. `gatewayd_plugins.yaml`. Then you must update the plugins configuration file with the desired plugin's configuration that is available in the plugin's repository as `gatewayd_plugin.yaml` (or inside the archive file of the plugin). Checksum files are also available in the plugin's repository as release assets and also inside the archive file of the plugin.
113146

114-
Alternatively you can manually download, extract and place the plugins' binaries in your desired location that is accessible to GatewayD via the plugins configuration file, aka. `gatewayd_plugins.yaml`.
147+
For more flags, please refer to the [CLI](/using-gatewayd/CLI) page or just run `gatewayd plugin install --help`.
115148

116149
For more information about plugins, please refer to the [plugins configuration](/using-gatewayd/plugins-configuration/plugins-configuration) and the [plugins](/using-plugins/plugins) page.
117150

getting-started/running-gatewayd.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
last_modified_date: 2024-01-16 20:49:17 +0100
2+
last_modified_date: 2024-01-29 21:30:54 +0100
33
layout: default
44
title: Running GatewayD
55
description: How to run GatewayD and test it with psql
@@ -61,7 +61,7 @@ Download and extract GatewayD and the [gatewayd-cache-plugin](/plugins/gatewayd-
6161
```bash
6262
mkdir gatewayd && cd gatewayd
6363
curl -L https://github.com/gatewayd-io/gatewayd/releases/download/{% github_latest_release gatewayd-io/gatewayd %}/gatewayd-linux-amd64-{% github_latest_release gatewayd-io/gatewayd %}.tar.gz | tar zxvf -
64-
./gatewayd plugin install --update --backup github.com/gatewayd-io/gatewayd-plugin-cache@{% github_latest_release gatewayd-io/gatewayd-plugin-cache %}
64+
./gatewayd plugin install --update --backup github.com/gatewayd-io/gatewayd-plugin-cache@latest
6565
```
6666

6767
The last command will do the following:

getting-started/welcome.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
last_modified_date: 2024-01-16 20:49:17 +0100
2+
last_modified_date: 2024-01-29 21:04:09 +0100
33
layout: default
44
title: Welcome
55
description: Introduction to GatewayD and its key features
@@ -60,7 +60,8 @@ These are just a few examples and the list is not exhaustive, as new plugins are
6060

6161
## What GatewayD does not do
6262

63-
GatewayD is not a silver bullet and won't solve all your database problems overnight.
63+
GatewayD is not a silver bullet and won't solve all your database problems overnight.
64+
6465
You still have to design and normalize your database schema, take and test backups, secure your database and do whatever you used to do before GatewayD. GatewayD came into existence to fix the black box mentality that surrounds databases to this very day.
6566

6667
Over time many plugins will be developed either by us or the community that will try to solve different issues arose from utilizing databases.

plugins/gatewayd-plugin-cache.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
last_modified_date: 2024-01-16 20:49:17 +0100
2+
last_modified_date: 2024-01-29 21:04:09 +0100
33
layout: default
44
title: gatewayd-plugin-cache
55
description: GatewayD plugin for caching query results in Redis.
@@ -68,6 +68,7 @@ plugins:
6868
- name: gatewayd-plugin-cache
6969
enabled: True
7070
localPath: ../gatewayd-plugin-cache/gatewayd-plugin-cache
71+
url: github.com/gatewayd-io/gatewayd-plugin-cache@latest
7172
args: ["--log-level", "info"]
7273
env:
7374
- MAGIC_COOKIE_KEY=GATEWAYD_PLUGIN

0 commit comments

Comments
 (0)