Skip to content

Commit

Permalink
Merge pull request #461 from mattermost/merge-master
Browse files Browse the repository at this point in the history
Merge `master` branch into `production`
  • Loading branch information
streamer45 authored Sep 18, 2024
2 parents ac374c1 + 87b0667 commit c2eb303
Show file tree
Hide file tree
Showing 19 changed files with 192 additions and 2,637 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ on:
jobs:
build:
runs-on: ubuntu-22.04
container: cimg/go:1.19
container: cimg/go:1.22
defaults:
run:
shell: bash
steps:
- name: build/checkout-repo
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: build/ensure-master-exists
Expand All @@ -22,6 +22,8 @@ jobs:
run: make test
- name: build/build
run: make build
- name: build/package-artifact
run: make package-artifact
- name: build/check-uncommitted-changes
run: |
# Assert that 'git status --porcelain' does not produce output
Expand All @@ -31,11 +33,12 @@ jobs:
exit 1
}
- name: build/persist-build
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: marketplace-build
path: dist/
path: dist/mattermost-marketplace.zip
retention-days: 2
compression-level: 0

deploy:
if: ${{ github.repository == 'mattermost/mattermost-marketplace' && (github.ref_name == 'master' || github.ref_name == 'production') }}
Expand All @@ -49,15 +52,17 @@ jobs:
env:
AWS_DEFAULT_REGION: us-east-1
steps:
- name: build/checkout-repo
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: deploy/checkout-repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: deploy/install-dependencies
run: npm i -g "serverless@<4.0.0"
- name: deploy/download-build
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: marketplace-build
path: dist/
path: dist
# Required because of https://github.com/actions/upload-artifact/issues/38
- name: deploy/set-artifact-permissions
run: chmod +x dist/*
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/notify-mm-blog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ jobs:
uses: mattermost/action-mattermost-notify@b7d118e440bf2749cd18a4a8c88e7092e696257a #v2.0.0
with:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL_1 }}
PAYLOAD: $(cat mattermost.json)
- name: Notify channel 2
uses: mattermost/action-mattermost-notify@b7d118e440bf2749cd18a4a8c88e7092e696257a #v2.0.0
with:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL_2 }}

PAYLOAD: $(cat mattermost.json)
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ linters-settings:
goimports:
local-prefixes: github.com/mattermost/mattermost-marketplace
govet:
check-shadowing: true
shadow: true
enable-all: true
disable:
- fieldalignment
Expand Down
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,21 @@ run-server:
## Compile the server as a lambda function
.PHONY: build-lambda
build-lambda:
GOOS=linux go build -ldflags="-s -w $(LDFLAGS)" -o dist/marketplace-lambda ./cmd/lambda/
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w $(LDFLAGS)" -tags lambda.norpc -o dist/bootstrap ./cmd/lambda/

## Package the lambda binary into a .zip artifact
.PHONY: package-artifact
package-artifact:
zip -j dist/mattermost-marketplace.zip dist/bootstrap

## Deploy the lambda stack
.PHONY: deploy-lambda
deploy-lambda: clean build-lambda
deploy-lambda: clean build-lambda package-artifact
serverless deploy --verbose --stage $(SLS_STAGE)

## Deploy the lambda function only to an existing stack
.PHONY: deploy-lambda-fast
deploy-lambda-fast: clean build-lambda
deploy-lambda-fast: clean build-lambda package-artifact
serverless deploy function -f server --stage $(SLS_STAGE)

## Update plugins.json
Expand Down
2 changes: 1 addition & 1 deletion cmd/generator/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"time"

"github.com/blang/semver"
mattermostModel "github.com/mattermost/mattermost-server/v6/model"
mattermostModel "github.com/mattermost/mattermost/server/public/model"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion cmd/generator/bundles.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var migrateCmd = &cobra.Command{
Short: "Migrate existing plugins in plugins.json to the newest structure.",
Long: "The migrate command adds platform-specific bundles to each existing entry.",
Example: "generator migrate",
RunE: func(command *cobra.Command, args []string) error {
RunE: func(command *cobra.Command, _ []string) error {
dbFile, err := command.Flags().GetString("database")
if err != nil {
return err
Expand Down
6 changes: 3 additions & 3 deletions cmd/generator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

"github.com/blang/semver"
"github.com/google/go-github/v28/github"
mattermostModel "github.com/mattermost/mattermost-server/v6/model"
mattermostModel "github.com/mattermost/mattermost/server/public/model"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
Expand All @@ -28,7 +28,7 @@ import (
)

const (
defaultRemotePluginStore = "https://plugins-store.test.mattermost.com/release"
defaultRemotePluginStore = "https://plugins.releases.mattermost.com/release"
defaultGitHubOrg = "mattermost"
)

Expand All @@ -54,7 +54,7 @@ var generatorCmd = &cobra.Command{
PersistentPreRunE: InitCommand,
// SilenceErrors allows us to explicitly log the error returned from generatorCmd below.
SilenceErrors: true,
RunE: func(command *cobra.Command, args []string) error {
RunE: func(command *cobra.Command, _ []string) error {
command.SilenceUsage = true

dbFile, err := command.Flags().GetString("database")
Expand Down
4 changes: 2 additions & 2 deletions cmd/marketplace/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"time"

"github.com/gorilla/mux"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost/server/public/model"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -37,7 +37,7 @@ func init() {
var serverCmd = &cobra.Command{
Use: "server",
Short: "Run the provisioning server.",
RunE: func(command *cobra.Command, args []string) error {
RunE: func(command *cobra.Command, _ []string) error {
command.SilenceUsage = true

debug, _ := command.Flags().GetBool("debug")
Expand Down
66 changes: 58 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,67 @@
module github.com/mattermost/mattermost-marketplace

go 1.16
go 1.22

toolchain go1.22.6

require (
github.com/akrylysov/algnhsa v0.0.0-20190319020909-05b3d192e9a7
github.com/akrylysov/algnhsa v1.1.0
github.com/blang/semver v3.5.1+incompatible
github.com/google/go-github/v28 v28.0.0
github.com/gorilla/mux v1.8.0
github.com/mattermost/mattermost-server/v6 v6.0.0-20221122212622-0509e78744bf
github.com/gorilla/mux v1.8.1
github.com/mattermost/mattermost/server/public v0.1.7-0.20240912172357-70fe2abea67e
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.6.1
github.com/stretchr/testify v1.8.1
golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783
golang.org/x/sync v0.1.0
github.com/stretchr/testify v1.9.0
golang.org/x/oauth2 v0.21.0
golang.org/x/sync v0.7.0
)

require (
github.com/aws/aws-lambda-go v1.47.0 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dyatlov/go-opengraph/opengraph v0.0.0-20220524092352-606d7b1e5f8a // indirect
github.com/fatih/color v1.17.0 // indirect
github.com/francoispqt/gojay v1.2.13 // indirect
github.com/go-asn1-ber/asn1-ber v1.5.7 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-hclog v1.6.3 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.6.1 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattermost/go-i18n v1.11.1-0.20211013152124-5c415071e404 // indirect
github.com/mattermost/ldap v0.0.0-20231116144001-0f480c025956 // indirect
github.com/mattermost/logr/v2 v2.0.21 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/pborman/uuid v1.2.1 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/philhofer/fwd v1.1.3-0.20240612014219-fbbf4953d986 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/tinylib/msgp v1.2.0 // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/wiggin77/merror v1.0.5 // indirect
github.com/wiggin77/srslog v1.0.1 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240722135656-d784300faade // indirect
google.golang.org/grpc v1.65.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit c2eb303

Please sign in to comment.