Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Karoid/4fea344790ceac7a0232468beebac084 to your computer and use it in GitHub Desktop.

Select an option

Save Karoid/4fea344790ceac7a0232468beebac084 to your computer and use it in GitHub Desktop.
How to build unsupported mattermost plugin os and architectures

The reason why mattermost plugins do not run on different OS and architectures is because the go-lang compilation version is not defined.

You just need to add the compiled executable files from go-lang to the existing release files.

  1. After extracting the tar.gz file downloaded from the release, place the compiled executable in the server/dist subdirectory.
git clone https://github.com/mattermost-community/mattermost-plugin-bitbucket.git
cd server && env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -trimpath -o dist/plugin-linux-arm64;

download release file, extract it. Put executable inside release file server/dist

  1. Grant execution permissions to the executable file.
cd server/dist && chmod +x plugin-*
  1. Add the executable file path to plugins.json.
    "server": {
        "executables": {
            "linux-amd64": "server/dist/plugin-linux-amd64",
            *"linux-arm64": "server/dist/plugin-linux-arm64",*
            "darwin-amd64": "server/dist/plugin-darwin-amd64",
            "windows-amd64": "server/dist/plugin-windows-amd64.exe"
        },
        "executable": ""
    },
  1. Compress it back to tar.gz format.
tar -czvf bitbucket.tar.gz bitbucket/
  1. Upload the plugin and apply it.

Korean Explanation

mattermost plugin이 서로 다른 OS와 Archetecture에서 구동되지 않는 이유는 go-lang의 컴파일 버전이 정의되어 있지 않기 때문이다.

기존 release 파일에서 go-lang 의 컴파일된 실행파일만 추가하면 된다.

  1. release에서 다운받은 tar.gz 파일을 압축해제하면 server/dist 하부에 실행파일을 컴파일 해서 넣는다.

  2. 실행파일의 실행권한을 준다

  3. plugins.json에 실행파일 경로를 추가한다.

  4. tar.gz 압축한다

  5. 플러그인을 업로드해서 적용한다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment