Skip to content

Commit 06df550

Browse files
authored
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
1 parent e4f1e31 commit 06df550

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

.dockerignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
/*.swp
2-
/scripts
32
docker-compose.yaml

cmd/storagenode/alpha/amd64.Dockerfile

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
# build
2-
FROM golang:1.11-alpine as build-env
2+
FROM golang:1.12-alpine as build-env
33

44
ENV CGO_ENABLED=1
5+
ENV GO111MODULE=on
56

67
ADD . /go/src/storj.io/storj
78
WORKDIR /go/src/storj.io/storj/cmd/storagenode
89

910
# dependencies + binary
10-
RUN apk add git gcc musl-dev
11-
#RUN unset GOPATH && go mod vendor
12-
RUN go build -a -installsuffix cgo -o storagenode .
11+
RUN apk add git gcc musl-dev bash
12+
RUN git reset --hard
13+
RUN git clean -dffx
14+
RUN ../../scripts/release.sh build -a -installsuffix cgo -o storagenode .
1315
RUN mkdir config identity
1416

1517
# final stage
@@ -39,4 +41,4 @@ COPY --from=build-env /go/src/storj.io/storj/cmd/storagenode/alpha/dashboard.sh
3941
RUN ls -l /app
4042

4143
ENTRYPOINT ["./entrypoint.sh"]
42-
#ENTRYPOINT ./storagenode run --config-dir="/app/config" --identity-dir="/app/identity" --kademlia.external-address=${ADDRESS} --kademlia.operator.email=${EMAIL} --kademlia.operator.wallet=${WALLET}
44+
#ENTRYPOINT ./storagenode run --config-dir="/app/config" --identity-dir="/app/identity" --kademlia.external-address=${ADDRESS} --kademlia.operator.email=${EMAIL} --kademlia.operator.wallet=${WALLET}

scripts/release.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env bash
22

3-
set -eu
3+
set -eu
44
set -o pipefail
55

6-
echo -n "Build timestamp: "
6+
echo -n "Build timestamp: "
77
TIMESTAMP=$(date +%s)
88
echo $TIMESTAMP
99

10-
echo -n "Git commit: "
10+
echo -n "Git commit: "
1111
if [[ "$(git diff --stat)" != '' ]] || [[ -n "$(git status -s)" ]]; then
1212
COMMIT=$(git rev-parse HEAD)-dirty
1313
RELEASE=false
@@ -17,11 +17,11 @@ else
1717
fi
1818
echo $COMMIT
1919

20-
echo -n "Tagged version: "
20+
echo -n "Tagged version: "
2121
VERSION=$(git describe --tags --exact-match --match "v[0-9]*.[0-9]*.[0-9]*")
2222
echo $VERSION
2323

24-
echo Running "go $@"
24+
echo Running "go $@"
2525
exec go "$1" -ldflags \
2626
"-X storj.io/storj/internal/version.buildTimestamp=$TIMESTAMP
2727
-X storj.io/storj/internal/version.buildCommitHash=$COMMIT

0 commit comments

Comments
 (0)