prefetch maven 25/2025/3
authorC.J. Collier <cjcollier@linuxfoundation.org>
Tue, 19 Jul 2016 22:15:09 +0000 (15:15 -0700)
committerC.J. Collier <cjcollier@linuxfoundation.org>
Wed, 20 Jul 2016 23:46:54 +0000 (16:46 -0700)
* call maven install function
* maven install function installs from file in /vagrant

Jenkins will be modified to point to this pre-installed maven.  This
will eliminate many problems caused by an inability to fetch common
files.

Another solution would be to host a caching proxy within Vexxhost and
set the http_proxy and https_proxy environment variables to use this
host.

Change-Id: I76d1f3c2526b45dbe0fa4b2a17d3e30d434092ce
Signed-off-by: C.J. Collier <cjcollier@linuxfoundation.org>
vagrant/basebuild/bootstrap.sh
vagrant/lib/bootstrap-functions.sh

index 4aea50d..87eb386 100644 (file)
@@ -7,6 +7,7 @@ set -e
 . /vagrant/lib/bootstrap-functions.sh
 
 do_setup
+do_mvn_install
 
 # record the bootstrap.sh checksum
 sha1sum $0 > /etc/bootstrap.sha
index 84e6595..027c69d 100644 (file)
@@ -5,14 +5,12 @@ do_setup() {
 }
 
 do_mvn_install() {
-    MAVEN_MIRROR=apache.mirrors.tds.net
     MAVEN_VERSION=3.3.9
-    MAVEN_RELEASE=http://${MAVEN_MIRROR}/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz
+    MAVEN_FILENAME=apache-maven-${MAVEN_VERSION}-bin.tar.gz
     MAVEN_HOME=/opt/apache/maven
 
-    mkdir -p /opt/apache/maven
-    wget -O - ${MAVEN_RELEASE} | \
-        tar xz -C ${MAVEN_HOME} --strip-components 1
+    mkdir -p ${MAVEN_HOME}
+    tar -C ${MAVEN_HOME} --strip-components 1 -xzf /vagrant/${MAVEN_FILENAME}
 }
 
 
@@ -223,7 +221,7 @@ rh_install_pkgs() {
     OUTPUT=$(rpm -qa epel-release)
     if [ -z "$OUTPUT" ]
     then
-        yum install -q -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
+        yum install -q -y /vagrant/epel-release-latest-7.noarch.rpm
     fi
 
     # Install components to build Ganglia modules