revert some changes

This commit is contained in:
Yuli
2024-04-28 18:48:37 +03:00
parent 4a7bb2937d
commit 4f1702546b
2 changed files with 23 additions and 1 deletions

View File

@@ -2,7 +2,7 @@
# STEP 1 build executable file
##############################
FROM golang:alpine AS builder
RUN apk update && apk add --no-cache git gcc libc-dev openssl
RUN apk update && apk add --no-cache git gcc libc-dev openssl && go install github.com/gobuffalo/packr/packr@latest
WORKDIR /go/src/securitybunker/databunker/src/
COPY src/go.mod ./deps
RUN cat ./deps | grep -v storage > ./go.mod && go mod download

View File

@@ -7,7 +7,29 @@ HASH=$(git rev-parse --short=12 HEAD)
TIMESTAMP=$(date +%Y%m%d%H%M%S) # Current timestamp
FULL_VERSION=$VERSION-$TIMESTAMP-$HASH
if [ -x "~/go/bin/packr" ]; then
echo "Found ~/go/bin/packr"
elif [ -x "packr" ]; then
echo "Fond packr"
else
go install github.com/gobuffalo/packr/packr@latest
fi
cd src
go get -d -v
if [ -x "~/go/bin/packr" ]; then
~/go/bin/packr
elif [ -x "packr" ]; then
packr
fi
go build -v -ldflags="-s -w -X main.version=$FULL_VERSION" -o ../databunker
if [ -x "~/go/bin/packr" ]; then
~/go/bin/packr clean
elif [ -x "packr" ]; then
packr clean
fi
cd ..