Skip to content

Commit 3766099

Browse files
committed
review feedback
go-winio is now safe to include in compile strict bash checks and fix indents getGitCommit.sh switch docker build from USE_RELEASE to NIGHTLY_BUILD
1 parent e6d5215 commit 3766099

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

Dockerfile

+6-9
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,18 @@ CMD ["--help"]
3737
# by far, most of the compilation time is building vendor packages
3838
# build the vendor dependencies as a separate docker caching layer
3939
COPY ./vendor/ /go/src/github.com/contiv/netplugin/vendor/
40-
# there is a bug in go-winio, remote the grep -v after this merges:
41-
# https://github.com/contiv/netplugin/pull/999
42-
RUN GOGC=1500 \
43-
go install -ldflags "-s -w" \
44-
$(go list ./vendor/... | grep -v go-winio)
40+
41+
RUN GOGC=1500 go install -ldflags "-s -w" $(go list ./vendor/...)
4542

4643
# build the netplugin binaries
4744
COPY ./ /go/src/github.com/contiv/netplugin/
4845

4946
ARG BUILD_VERSION=""
50-
ARG USE_RELEASE=""
47+
ARG NIGHTLY_RELEASE=""
5148

5249
RUN GOPATH=/go/ \
5350
BUILD_VERSION="${BUILD_VERSION}" \
54-
USE_RELEASE="${USE_RELEASE}" \
51+
NIGHTLY_RELEASE="${NIGHTLY_RELEASE}" \
5552
make compile \
56-
&& cp scripts/contrib/completion/bash/netctl /etc/bash_completion.d/netctl \
57-
&& netplugin -version
53+
&& cp scripts/contrib/completion/bash/netctl /etc/bash_completion.d/netctl \
54+
&& netplugin -version

Makefile

+4-3
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,10 @@ compile:
9797
run-build: deps checks clean compile
9898

9999
compile-with-docker:
100-
docker build --build-arg USE_RELEASE=${USE_RELEASE} \
101-
--build-arg BUILD_VERSION=${BUILD_VERSION} \
102-
-t netplugin:$${BUILD_VERSION:-devBuild}-$$(./scripts/getGitCommit.sh) .
100+
docker build \
101+
--build-arg NIGHTLY_RELEASE=${NIGHTLY_RELEASE} \
102+
--build-arg BUILD_VERSION=${BUILD_VERSION} \
103+
-t netplugin:$${BUILD_VERSION:-devBuild}-$$(./scripts/getGitCommit.sh) .
103104

104105
build-docker-image: start
105106
vagrant ssh netplugin-node1 -c 'bash -lc "source /etc/profile.d/envvar.sh && cd /opt/gopath/src/github.com/contiv/netplugin && make host-build-docker-image"'

scripts/getGitCommit.sh

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

3+
set -euo pipefail
4+
35
if command -v git &>/dev/null && git rev-parse &>/dev/null; then
4-
GIT_COMMIT=$(git rev-parse --short HEAD)
5-
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
6-
GIT_COMMIT="$GIT_COMMIT-unsupported"
7-
fi
6+
GIT_COMMIT=$(git rev-parse --short HEAD)
7+
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
8+
GIT_COMMIT="$GIT_COMMIT-unsupported"
9+
fi
810
echo $GIT_COMMIT
911
exit 0
1012
fi
1113
echo >&2 'error: unable to determine the git revision'
1214
exit 1
13-

0 commit comments

Comments
 (0)