Matterbuild is an internal Mattermost chatops tool for generating Mattermost releases.
Essentials:
- Install Go
Optionals:
- Tilt v0.13+ (to deploy on a local dev K8s cluster)
- kind v0.8+ (to spin up a local dev K8s cluster)
- kustomize v3.6+
This project uses tilt
to deploy to local Kubernetes cluster. In order to do this you need a local Kuberetes cluster (kind
is recommended).
kind create cluster --name matterbuild
Matterbuild deployment to any cluster and any environment (dev, prod, etc) depends on existense of deploy/config/config.json
file, this file is .gitignore
d and you can safeley choose to copy sample config there for local development and testing:
cp config.json deploy/config/
Point KUBECONFIG
to the newly created cluster, and start tilt
and open http://localhost:8080/:
make run
Note: If you don't want to use Tilt nor deploy to local cluster you can ignore it and simply start the binary server:
NOTILT=1 make run
Running all tests:
make test
Generate github mocks:
make mocks
- Navigate to http://localhost:8065/_redirect/integrations/commands/add
- Set Command Trigger Word to
matterbuild
- Set Request URL to
http://localhost:8080/slash_command
- Set Request Method to
POST
- Click
Save
- Navigate to any channel and type
/matterbuild cutplugin --tag v0.6.3 --repo mattermost-plugin-demo --commitSHA 24dbd65762612fb72af6e7c30b40e9e8d0a90968
Invoke matterbuild commands using curl:
curl -X POST http://localhost:8080/slash_command -d "command=/matterbuild&token=&user_id=" -d "text=cutplugin+--tag+v0.4.1+--repo+mattermost-plugin-demo"
To test the cutplugin you have to:
- Connect to Mattermost VPN
- Get AWS Vault credentials
- Signed public certificate by Vault
- Generate Github Token
- Set following fields in
config.json
before running matterbuild
// Used to authenticate invoking slash command
"AllowedTokens": ["irkngs1z4jrcz8t9aiyzu8zx3r", ""],
"AllowedUsers": ["gcye3z5pnpgibkcfhpemsp78ey", ""],
"GithubAccessToken": "---",
"GithubOrg": "mattermost",
"PluginSigningSSHKeyPath": "/Users/<user>/.ssh/id_rsa",
"PluginSigningSSHPublicCertPath": "/Users/<user>/.ssh/signed-cert.pub",
"PluginSigningSSHUser": "---",
"PluginSigningSSHHost": "---",
"PluginSigningSSHHostPublicKey": "199.199.222.222 ecdsa-sha2-nistp256 AyNTYAAABBBDZEF6pmnR=",
"PluginSigningAWSAccessKey": "---",
"PluginSigningAWSSecretKey": "---",
"PluginSigningAWSRegion": "us-east-1",
"PluginSigningAWSS3PluginBucket": "mattermost-toolkit-dev"
There are helper Makefile targets to cut a release following semver:
make patch
: to cut a patch releasemake minor
: to cut a minor releasemake major
: to cut a major release