34 lines
643 B
Bash
Executable File
34 lines
643 B
Bash
Executable File
#!/bin/bash
|
|
|
|
VERSION=1.1.0
|
|
APP=mailhog
|
|
DEPOT=https://github.com/mailhog/MailHog.git
|
|
GIT_VERSION=v$VERSION-beta1
|
|
DEB_VERSION=$VERSION-$(date +%Y%m%d%H%M)
|
|
DEBIAN_VERSION_CODENAME=bullseye
|
|
IMAGE_SIZE=2
|
|
PACKAGE_DEPENDENCY="build-essential"
|
|
|
|
main() {
|
|
base_package_upgrade
|
|
install_package_dependency
|
|
install_go
|
|
get_git_source
|
|
build
|
|
makedeb
|
|
}
|
|
|
|
build() {
|
|
cd /tmp/${APP}
|
|
PATH=$PATH:/usr/local/go/bin
|
|
go build -o mailhog main.go
|
|
}
|
|
|
|
makedeb(){
|
|
PATH_DEB=/tmp/src/rootfs
|
|
|
|
cp /tmp/${APP}/mailhog ${PATH_DEB}/usr/bin/mailhog
|
|
sed -i "s/%VERSION%/$DEB_VERSION/" ${PATH_DEB}/DEBIAN/control
|
|
fakeroot dpkg-deb -Z gzip --build ${PATH_DEB} /tmp/dist
|
|
}
|