Skip to content

Commit 9676e9f

Browse files
authored
Fix failures when make directly (#8419)
Make iso fails if it is not running in a build container. Fix build scripts to be able to run make directly.
1 parent 44d6f81 commit 9676e9f

File tree

5 files changed

+6
-8
lines changed

5 files changed

+6
-8
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ drone exec
6262

6363
To build inside a Docker container:
6464
```shell
65-
docker run -v $(pwd):/go/src/github.com/vmware/vic gcr.io/eminent-nation-87317/vic-build-image:tdnf make all
65+
docker run -v $GOPATH/bin:/go/bin -v $(pwd):/go/src/github.com/vmware/vic gcr.io/eminent-nation-87317/vic-build-image:tdnf make all
6666
```
6767

6868
To build directly, you also need the Go 1.8 toolchain installed:

infra/build-image/docker-iso-build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function main {
3434
-v $GOPATH/src/github.com/vmware/vic/bin:/go/src/github.com/vmware/vic/bin \
3535
-e DEBUG=${DEBUG} \
3636
-e BUILD_NUMBER=${BUILD_NUMBER} \
37-
gcr.io/eminent-nation-87317/vic-build-image:${PKGMGR:-tdnf} /bin/bash -c "$*"
37+
gcr.io/eminent-nation-87317/vic-build-image:${PKGMGR:-tdnf} "$*"
3838
}
3939

4040
REPO="photon-2.0"

infra/build-image/setup-repo.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ if ! git remote show -n origin >/dev/null 2>&1 ; then
8888
git init . && git remote add origin ${url}
8989
fi
9090

91-
if [ ! -z ${refspec} ]; then
91+
if [ -n "${refspec}" ]; then
9292
# we don't limit the depth as that was resulting in failure to find the most recent tag for a given commit
9393
git fetch origin -v ${refspec}
9494
if [ "$(git rev-parse --abbrev-ref HEAD)" != "$branch" ]; then
9595
git checkout -b ${branch} ${localbranch}
9696
fi
9797
fi
9898

99-
if [ -n ${localbranch} ]; then
99+
if [ -n "${localbranch}" ]; then
100100
# try to fast-forward but just checkout if that fails
101101
git pull --ff-only || git checkout ${localbranch}
102102
fi

isos/base.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ DIR=$(dirname $(readlink -f "$0"))
2121
. $DIR/base/utils.sh
2222

2323
function usage() {
24-
echo "Usage: $0 -p package-name(tgz) [-c package-cache]" 1>&2
24+
echo "Usage: $0 -p package-name(tgz) [-c package-cache] [-r repo]" 1>&2
2525
exit 1
2626
}
2727

isos/base/utils.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
[ -n "$DEBUG" ] && set -x
1919
BASE_DIR=$(dirname $(readlink -f "$BASH_SOURCE"))
2020

21-
if [ -z ${BUILD_NUMBER+x} ]; then
22-
BUILD_NUMBER=0
23-
fi
21+
BUILD_NUMBER=${BUILD_NUMBER:-0}
2422

2523
VERSION=`git describe --abbrev=0 --tags`-${BUILD_NUMBER}-`git rev-parse --short HEAD`
2624

0 commit comments

Comments
 (0)