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.
- 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
- Grant execution permissions to the executable file.
cd server/dist && chmod +x plugin-*- 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": ""
},- Compress it back to tar.gz format.
tar -czvf bitbucket.tar.gz bitbucket/- Upload the plugin and apply it.
mattermost plugin이 서로 다른 OS와 Archetecture에서 구동되지 않는 이유는 go-lang의 컴파일 버전이 정의되어 있지 않기 때문이다.
기존 release 파일에서 go-lang 의 컴파일된 실행파일만 추가하면 된다.
-
release에서 다운받은 tar.gz 파일을 압축해제하면 server/dist 하부에 실행파일을 컴파일 해서 넣는다.
-
실행파일의 실행권한을 준다
-
plugins.json에 실행파일 경로를 추가한다.
-
tar.gz 압축한다
-
플러그인을 업로드해서 적용한다