Fix #1957. Boards dev guide. (#2390)

* Fix #1957. Boards dev guide.

* Remove incomplete link

* Clarify the config.json settings

* Recommend forking and cloning the repo

* Cleanup instructions

* make webapp before plugin deploy
This commit is contained in:
Chen-I Lim 2022-02-25 09:37:40 -08:00 committed by GitHub
parent 86b920ccd2
commit cd6be86a36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 71 additions and 3 deletions

View file

@ -49,7 +49,7 @@ Most development can be done on the Personal Server edition. Please refer to the
First, install basic dependencies:
* Go 1.15+
* Node 10+ and npm
* Node 16.3+ and npm
* Mingw64 on Windows
```

View file

@ -1,5 +1,7 @@
# Developer Tips and Tricks
These tips and tricks apply to developing the standalone Personal Server of Focalboard. For most features, this is the easiest way to get started working against code that ships across editions. For working with Mattermost Boards, refer to the [Mattermost Boards developer's guide](mattermost-boards-dev-guide.md).
## Installation prerequisites
Check that you have recent versions of the basic dependencies installed:
@ -20,9 +22,9 @@ On Linux, to build the Linux app:
* `sudo apt-get install libwebkit2gtk-4.0-dev`
* `sudo apt-get install autoconf dh-autoreconf`
## Clone the project source code
## Fork and clone the project source code
Clone the [GitHub repo here](https://github.com/mattermost/focalboard).
Fork the [Focalboard GitHub repo](https://github.com/mattermost/focalboard), and clone it locally.
## Build and run from the terminal

View file

@ -0,0 +1,66 @@
# Mattermost Boards Developer's Guide
[Mattermost Boards](https://mattermost.com/boards/) is the Focalboard (aka Boards) plugin running in Mattermost. It is pre-packaed, and runs out of the box with Mattermost 6.0 and later.
To build your own version of it:
1. Build [mattermost-plugin](https://github.com/mattermost/focalboard/tree/main/mattermost-plugin) in the [Focalboard repo](https://github.com/mattermost/focalboard)
2. Upload it as a [custom plugin to your Mattermost server](https://developers.mattermost.com/integrate/admin-guide/admin-plugins-beta/#custom-plugins)
Here are the steps in more detail:
### Building the Boards plugin
Fork the [Focalboard repo](https://github.com/mattermost/focalboard), clone it locally, and follow the steps in the readme to set up your dev environment.
Install dependencies:
```
# First-time setup dependencies
cd mattermost-plugin/webapp
npm install --no-optional
cd ../..
make prebuild
```
Build the plugin:
```
# Build webapp
make webapp
# Build plugin
cd mattermost-plugin
make dist
```
Refer to the [dev-release.yml](https://github.com/mattermost/focalboard/blob/main/.github/workflows/dev-release.yml#L168) workflow for the up-to-date commands that are run as part of CI.
### Uploading the plugin to your server
You can manually upload the plugin to your Mattermost Server:
1. Enable [custom plugins](https://developers.mattermost.com/integrate/admin-guide/admin-plugins-beta/#custom-plugins) by setting `PluginSettings > EnableUploads` to `true` in the Mattermost `config.json` file
2. Navigate to **System Console > Plugins > Management** and upload the generated `.tar.gz` package in your `mattermost-plugin/dist` directory
3. Enable it (if needed)
Alternatively, you can install Mattermost locally and use `make deploy` to auto-deploy it for you:
First, build and run Mattermost locally:
1. Follow the [Mattermost Developers Guide](https://developers.mattermost.com/contribute/server/developer-setup/) to set up your environment
* In particuler, make sure Docker is set up and running
2. Fork [mattermost-webapp](https://github.com/mattermost/mattermost-webapp), clone it locally, and `make build`
3. Fork [mattermost-server](https://github.com/mattermost/mattermost-server) and clone it locally
3. Run `make config-reset` to generate the `config/config.json` file
4. Edit `config/config.json`:
* Set `ServiceSettings > SiteURL` to `http://localhost:8065` ([docs](https://docs.mattermost.com/configure/configuration-settings.html#site-url))
* Set `ServiceSettings > EnableLocalMode` to `true` ([docs](https://docs.mattermost.com/configure/configuration-settings.html#enable-local-mode))
* Set `PluginSettings > EnableUploads` to `true` ([docs](https://developers.mattermost.com/integrate/admin-guide/admin-plugins-beta/#custom-plugins))
5. Add an ENV var `MM_SERVICESETTINGS_SITEURL` with the same site URL used in the config
6. Run `make run-server` in Mattermost
Now, to build and deploy the Boards plugin:
1. Clone / fork [mattermost/focalboard](https://github.com/mattermost/focalboard)
2. Install the dependencies (see above)
3. Run:
```
make webapp
cd mattermost-plugin
make deploy
```