If i modify source code, how to re-package or compile?


#1

Hi, guys!

I want to know that how to re-package or compile source code.

in my case,

I already modified web/handlers.go file

so, i want to re-package or compile sourcec

if anyone know that method, let me know how to figure out

thanks for sincerely


#2

so, i find use “make package” command for make mattermost.exe file …

when i use “make package” in /mattermost/mattermost-server/ folder

i got some error, the error is…

Packaging mattermost
rm -Rf dist
mkdir -p dist/mattermost/bin
mkdir -p dist/mattermost/logs
cp -RL config dist/mattermost
cp -RL fonts dist/mattermost
cp -RL templates dist/mattermost
cp -RL i18n dist/mattermost
sed -i'' -e 's|"ConsoleLevel": "DEBUG"|"ConsoleLevel": "INFO"|g' dist/mattermost/config/config.json
sed -i'' -e 's|"SiteURL": "http://localhost:8065"|"SiteURL": ""|g' dist/mattermost/config/config.json
sed -i'' -e 's|"SendEmailNotifications": true,|"SendEmailNotifications": false,|g' dist/mattermost/config/config.json
sed -i'' -e 's|"FeedbackEmail": "test@example.com",|"FeedbackEmail": "",|g' dist/mattermost/config/config.json
sed -i'' -e 's|"SMTPServer": "dockerhost",|"SMTPServer": "",|g' dist/mattermost/config/config.json
sed -i'' -e 's|"SMTPPort": "2500",|"SMTPPort": "",|g' dist/mattermost/config/config.json
mkdir -p dist/mattermost/client
cp -RL ../mattermost-webapp/dist/* dist/mattermost/client
cp build/MIT-COMPILED-LICENSE.md dist/mattermost
cp NOTICE.txt dist/mattermost
cp README.md dist/mattermost
cp /Users/username/go/bin/mattermost dist/mattermost/bin # from native bin dir, not cross-compiled
cp /Users/username/go/bin/platform dist/mattermost/bin # from native bin dir, not cross-compiled
cp: /Users/username/go/bin/platform: No such file or directory
make: *** [package] Error 1

if anyone know solutions, let me know that how to fix it?

thanks!


#3

I´m in the same case. I have read the documentation but i haven´t found anything. There are some guys that modify the makefile for linux version, but they do for version 3.5.1.

Anybody know the official way for version 5?


#4

Hi @bje and @raul03ma, thank you for reaching out.

Here is a documentation that might help you get started: https://developers.mattermost.com/contribute/getting-started/.

If this doesn’t help, just let me know and I’ll ask our engineers for further directions.


#5

Hi @amy.blais,

But if I understood well this is the way to install in a development environment with docker. But if I want to install in a production server, is the same way? I think the mattermost-server project should have a way to compile as a dist. I found a folder in this path mattermost-server/dist/mattermost that I think is what I want but I´m not sure. The only strange thing is the platform folder is empty and it shouldn´t.

Thanks a lot!!!


#6

Hi @raul03ma! Thank you for your question.

Would you like to join our Peer-to-peer Help channel in our build server to see if other community members would have ideas?

A lot of people in the community compile it themselves and they should have some ideas on how you can proceed.


#7

@raul03ma - One community member just shared an example of how he is packaging Mattermost for Arch Linux: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=mattermost !

I originally posted about this in Developer Toolkit channel, so you can follow that thread for any other ideas that people might share.


#8

Thank you very much, i am going to visit this links.