Forward-port release-alpha8 build script issues (#1726)

* releases: update alpha dockerfiles to embed release tags

Change-Id: I2978d3ed77d1b768be24ec9194bc404cd92e4700

* release script use plain shell

Change-Id: Ie4ca6633014e3bf00ac0c82e28905174a6ade95b

* removed /scripts from .dockerignore

Change-Id: Ib555236d62fb3dc354689284ac4a032d5b4b3aa8

* switch back to bash

Change-Id: Ie0958cde71cd396f44ac28c177f48df0bea7ba22

* fix go1.12 modules

Change-Id: If4c8364e7271f09febd1a6c8bfc731d723d344d9

* make sure the work tree is clean

Change-Id: Ie6e52af28e2bc52880d92a3b574d1f859fc8e88e
This commit is contained in:
JT Olio 2019-04-09 23:01:10 -06:00 committed by GitHub
parent 61ec92f2e8
commit ae855fd6eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 11 deletions

View File

@ -1,3 +1,2 @@
/*.swp /*.swp
/scripts
docker-compose.yaml docker-compose.yaml

View File

@ -1,15 +1,17 @@
# build # build
FROM golang:1.11-alpine as build-env FROM golang:1.12-alpine as build-env
ENV CGO_ENABLED=1 ENV CGO_ENABLED=1
ENV GO111MODULE=on
ADD . /go/src/storj.io/storj ADD . /go/src/storj.io/storj
WORKDIR /go/src/storj.io/storj/cmd/storagenode WORKDIR /go/src/storj.io/storj/cmd/storagenode
# dependencies + binary # dependencies + binary
RUN apk add git gcc musl-dev RUN apk add git gcc musl-dev bash
#RUN unset GOPATH && go mod vendor RUN git reset --hard
RUN go build -a -installsuffix cgo -o storagenode . RUN git clean -dffx
RUN ../../scripts/release.sh build -a -installsuffix cgo -o storagenode .
RUN mkdir config identity RUN mkdir config identity
# final stage # final stage
@ -39,4 +41,4 @@ COPY --from=build-env /go/src/storj.io/storj/cmd/storagenode/alpha/dashboard.sh
RUN ls -l /app RUN ls -l /app
ENTRYPOINT ["./entrypoint.sh"] ENTRYPOINT ["./entrypoint.sh"]
#ENTRYPOINT ./storagenode run --config-dir="/app/config" --identity-dir="/app/identity" --kademlia.external-address=${ADDRESS} --kademlia.operator.email=${EMAIL} --kademlia.operator.wallet=${WALLET} #ENTRYPOINT ./storagenode run --config-dir="/app/config" --identity-dir="/app/identity" --kademlia.external-address=${ADDRESS} --kademlia.operator.email=${EMAIL} --kademlia.operator.wallet=${WALLET}

View File

@ -1,13 +1,13 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
set -o pipefail set -o pipefail
echo -n "Build timestamp: " echo -n "Build timestamp: "
TIMESTAMP=$(date +%s) TIMESTAMP=$(date +%s)
echo $TIMESTAMP echo $TIMESTAMP
echo -n "Git commit: " echo -n "Git commit: "
if [[ "$(git diff --stat)" != '' ]] || [[ -n "$(git status -s)" ]]; then if [[ "$(git diff --stat)" != '' ]] || [[ -n "$(git status -s)" ]]; then
COMMIT=$(git rev-parse HEAD)-dirty COMMIT=$(git rev-parse HEAD)-dirty
RELEASE=false RELEASE=false
@ -17,11 +17,11 @@ else
fi fi
echo $COMMIT echo $COMMIT
echo -n "Tagged version: " echo -n "Tagged version: "
VERSION=$(git describe --tags --exact-match --match "v[0-9]*.[0-9]*.[0-9]*") VERSION=$(git describe --tags --exact-match --match "v[0-9]*.[0-9]*.[0-9]*")
echo $VERSION echo $VERSION
echo Running "go $@" echo Running "go $@"
exec go "$1" -ldflags \ exec go "$1" -ldflags \
"-X storj.io/storj/internal/version.buildTimestamp=$TIMESTAMP "-X storj.io/storj/internal/version.buildTimestamp=$TIMESTAMP
-X storj.io/storj/internal/version.buildCommitHash=$COMMIT -X storj.io/storj/internal/version.buildCommitHash=$COMMIT