mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-21 21:30:48 +02:00
Merge f382ed2d1a
into 76f9cea516
This commit is contained in:
commit
c76ed4437a
1 changed files with 13 additions and 0 deletions
13
build.sh
13
build.sh
|
@ -1,5 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# check if `go` is installed or not
|
||||||
|
if ! command -v go &> /dev/null; then
|
||||||
|
echo "Error: Go is not installed. Please install Go before running this script."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
BINFILE=watchtower
|
BINFILE=watchtower
|
||||||
if [ -n "$MSYSTEM" ]; then
|
if [ -n "$MSYSTEM" ]; then
|
||||||
BINFILE=watchtower.exe
|
BINFILE=watchtower.exe
|
||||||
|
@ -7,3 +13,10 @@ fi
|
||||||
VERSION=$(git describe --tags)
|
VERSION=$(git describe --tags)
|
||||||
echo "Building $VERSION..."
|
echo "Building $VERSION..."
|
||||||
go build -o $BINFILE -ldflags "-X github.com/containrrr/watchtower/internal/meta.Version=$VERSION"
|
go build -o $BINFILE -ldflags "-X github.com/containrrr/watchtower/internal/meta.Version=$VERSION"
|
||||||
|
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Error: Build failed!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Build successful!"
|
Loading…
Add table
Add a link
Reference in a new issue