watchtower/dockerfile/build/build.sh
Simon Aronsson 6b1dfcedc1 redo ci
2019-04-04 21:25:29 +02:00

28 lines
No EOL
567 B
Bash

#!/bin/bash -e
if [ -z "$1" ]
then
echo "No argument supplied, please either supply 'release' for a release build or 'ci' for ci build."
exit 1
fi
source /build_environment.sh
# Grab the last segment from the package name
name=${pkgName##*/}
echo "Running Tests $pkgName..."
(
go test -v $(glide novendor) || exit 1
)
if [ "$1" == "release" ]
then
echo "Release Building $pkgName..."
CGO_ENABLED=${CGO_ENABLED:-0} \
goreleaser
else
echo "Snapshot Building $pkgName..."
CGO_ENABLED=${CGO_ENABLED:-0} \
goreleaser --snapshot --skip-publish
fi