mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 09:37:02 +00:00
- Build from official golang image - Modernize docker build script - Remove sudo from docker-run.sh, relocate
34 lines
782 B
Bash
Executable File
34 lines
782 B
Bash
Executable File
#!/bin/bash
|
|
# install.sh
|
|
# description: Build, test, and install Inbucket. Should be executed inside a Docker container.
|
|
|
|
set -eo pipefail
|
|
|
|
installdir="${INBUCKET_HOME}"
|
|
srcdir="${INBUCKET_SRC}"
|
|
bindir="$installdir/bin"
|
|
|
|
# Setup
|
|
export GOBIN="$bindir"
|
|
builddate="$(date --iso-8601=seconds)"
|
|
cd "$srcdir"
|
|
go clean
|
|
|
|
# Build
|
|
echo "### Fetching Dependencies"
|
|
go get -d -v ./...
|
|
go get -v github.com/stretchr/testify
|
|
|
|
echo "### Testing Inbucket"
|
|
go test ./...
|
|
|
|
echo "### Building Inbucket"
|
|
mkdir -p "$bindir"
|
|
go build -o inbucket -race -ldflags "-X 'main.BUILD_DATE=$builddate'" -v .
|
|
|
|
echo "### Installing Inbucket"
|
|
mv inbucket "$bindir"
|
|
install etc/docker/inbucket.conf /etc/opt/inbucket.conf
|
|
install etc/docker/greeting.html /etc/opt/inbucket-greeting.html
|
|
cp -r themes "$installdir/"
|