aboutsummaryrefslogtreecommitdiffstats
path: root/docker/build/build-vespa-internal.sh
diff options
context:
space:
mode:
Diffstat (limited to 'docker/build/build-vespa-internal.sh')
-rwxr-xr-xdocker/build/build-vespa-internal.sh21
1 files changed, 13 insertions, 8 deletions
diff --git a/docker/build/build-vespa-internal.sh b/docker/build/build-vespa-internal.sh
index 3a141234333..1bef89d59b4 100755
--- a/docker/build/build-vespa-internal.sh
+++ b/docker/build/build-vespa-internal.sh
@@ -2,16 +2,22 @@
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
set -e
-if [ $# -ne 3 ]; then
- echo "Usage: $0 <vespa version> <caller uid> <caller gid>"
+if [ $# -ne 5 ]; then
+ echo "Usage: $0 <vespa version> <caller uid> <caller gid> <tmp build dir> <rpm dest dir>"
echo "This script should not be called manually."
exit 1
fi
VESPA_VERSION=$1
CALLER_UID=$2
CALLER_GID=$3
+BUILD_DIR=$4
+DEST_DIR=$5
+
+if ! [ -x ./dist.sh ]; then
+ echo ". is not a vespa-engine/vespa root directory"
+ exit 1
+fi
-cd /vespa
./dist.sh ${VESPA_VERSION}
yum -y install epel-release
@@ -19,8 +25,7 @@ yum -y install centos-release-scl
yum-config-manager --add-repo https://copr.fedorainfracloud.org/coprs/g/vespa/vespa/repo/epel-7/group_vespa-vespa-epel-7.repo
-yum-builddep -y --setopt="centos-sclo-rh-source.skip_if_unavailable=true" ~/rpmbuild/SPECS/vespa-${VESPA_VERSION}.spec
-rpmbuild -bb ~/rpmbuild/SPECS/vespa-${VESPA_VERSION}.spec
-chown ${CALLER_UID}:${CALLER_GID} ~/rpmbuild/RPMS/x86_64/*.rpm
-mv ~/rpmbuild/RPMS/x86_64/*.rpm /vespa/docker
-
+yum-builddep -y --setopt="centos-sclo-rh-source.skip_if_unavailable=true" $BUILD_DIR/SPECS/vespa-${VESPA_VERSION}.spec
+rpmbuild -bb $BUILD_DIR/SPECS/vespa-${VESPA_VERSION}.spec
+chown ${CALLER_UID}:${CALLER_GID} $BUILD_DIR/RPMS/x86_64/*.rpm
+mv $BUILD_DIR/RPMS/x86_64/*.rpm $DEST_DIR