Allow make deploy using token (#79)

* Allow make deploy using token

Introduce support for `MM_ADMIN_TOKEN` as an alternative to defining `MM_ADMIN_USERNAME` and `MM_ADMIN_PASSWORD.

* reverse README.md authentication schemes

* wrap errors

* Update build/deploy/main.go

Co-Authored-By: Ben Schumacher <ben.schumacher@mattermost.com>

* fix linting

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
This commit is contained in:
Jesse Hallam 2020-02-08 11:14:26 -04:00 committed by GitHub
parent adf353748e
commit 282a8cf227
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 13 deletions

View file

@ -34,7 +34,7 @@ This will produce a single plugin file (with support for multiple architectures)
dist/com.example.my-plugin.tar.gz
```
There is a build target to automate deploying and enabling the plugin to your server, but it requires configuration and [http](https://httpie.org/) to be installed:
There is a build target to automate deploying and enabling the plugin to your server, but it requires login credentials:
```
export MM_SERVICESETTINGS_SITEURL=http://localhost:8065
export MM_ADMIN_USERNAME=admin
@ -42,6 +42,13 @@ export MM_ADMIN_PASSWORD=password
make deploy
```
or configuration of a [personal access token](https://docs.mattermost.com/developer/personal-access-tokens.html):
```
export MM_SERVICESETTINGS_SITEURL=http://localhost:8065
export MM_ADMIN_TOKEN=j44acwd8obn78cdcx7koid4jkr
make deploy
```
Alternatively, if you are running your `mattermost-server` out of a sibling directory by the same name, use the `deploy` target alone to unpack the files into the right directory. You will need to restart your server and manually enable your plugin.
In production, deploy and upload your plugin via the [System Console](https://about.mattermost.com/default-plugin-uploads).