You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

27 lines
642 B

#! /bin/bash
# ./build.sh exchange 1.0 domain
APP=$1
VERSION=$2
DOMAIN=$3
GO111MODULE=on
CGO_ENABLED=0
GOOS=linux
GOARCH=amd64
go build -o target/$APP cmd/$APP/main.go
if [ -n "$VERSION" ]; then
cp -f /usr/share/zoneinfo/Asia/Shanghai ./localtime
if [ -n "$DOMAIN" ]; then
echo "docker build -t $DOMAIN/sig-$APP:$VERSION --build-arg APP=$APP ."
docker build -t $DOMAIN/sig-$APP:$VERSION --build-arg APP=$APP .
else
echo "docker build -t sig-$APP:$VERSION --build-arg APP=$APP ."
docker build -t sig-$APP:$VERSION --build-arg APP=$APP .
fi
rm -f localtime
fi
echo "$APP build finished"