Goprod - Go production in seconds!
GoProd is a simple tool that let you package your Golang app in seconds!
$ goprod \
-combo="linux/arm;linux/i386;linux/arm64;linux/amd64;windows/amd64;windows/i386" \
-builddir="build" \
-tags="gui"
To install from source: go run main.go -binname="goprod" -combo="$(go env GOOS)/$(go env GOARCH)" && apt install ./build/deb/goprod*.deb
To get a prebuild binary:
# wget 'https://static.mrcyjanek.net/abstruse/apt-repository/mrcyjanek-repo/mrcyjanek-repo_2.0-1_all.deb' && \
apt install ./mrcyjanek-repo_2.0-1_all.deb && \
rm ./mrcyjanek-repo_2.0-1_all.deb && \
apt update \
apt install goprod
Goprod exist because I want to package my programs with ease, and I expect thhem to 'just work', I don't care about proper debian packaging (well I do - but not here.). Here are all possible options
You can build and package for:
I generally recommend you using the docker image if you have some CI/CD solution installed (btw you should use Abstruse). If you want to run something on your machine just for development - then grab a copy of gcc
and g++
and checkinstall
, and make sure that /bin/x86_64-linux-gnu-g++
is a symlink to your gcc, on debian it's automatic (afaik) but on arch I had to do that manually. So keep this in mind when something goes wrong with GCC.
For an reference app check out magnetgraph I use goprod to package it
You need to install depedencies, for debian check docker/
for an up-to-date list of all depedencies (you usually don't need all of them, unless you deploy from the machine on which you work.)
So list of required things:
golang
gcc
and g++
gcc-mingw-w64-x86-64-win32
g++-mingw-w64-x86-64-win32
goprod update-ndk
- this command will update
(if required) the ndk and place it by default in ~/Android/Sdk/ndkgoprod accept-license
will accept the sdk licenses, so you will be able to compile things for android.default-jre
is required.goprod
is accessible there as a command, together with everything configured, except for your email - you may want to do git config user.email [email protected]
and git config user.name "Your Name"
, because this name and email is used to package debian package.
There are a couple of docker images available, and if you feel bad about using the public docker registry - make docker
:
mrcyjanek/goprod:core
goprod
executable, and (sometimes) not it's up to date version (it's a cached version from my apt, in the other versions it is getting updated by compiling what's in this repo). It's used to build other docker images.darwin
builds afaik, but I didn't really test it.mrcyjanek/goprod:nodejs
core
but with nodejs installed. Why? Sometimes you may want to use some nodejs thing to build frontend, that's why.mrcyjanek/goprod:core-android
mrcyjanek/goprod:nodejs-android
mrcyjanek/goprod:core-linux
mrcyjanek/goprod:nodejs-linux
mrcyjanek/goprod:core-windows
mrcyjanek/goprod:nodejs-windows