Remove honeycomb and hc2vpp Ubuntu 14.04 jobs
[ci-management.git] / jjb / hc2vpp / include-raw-hc2vpp-integration-prebuild.sh
1 #!/bin/bash
2
3 set -ex
4
5 # Download the latest VPP java API package
6 URL="https://nexus.fd.io/service/local/artifact/maven/content"
7 VERSION="RELEASE"
8 GROUP="io.fd.vpp"
9 ARTIFACTS="vpp-api-java"
10
11 VERSION=`./vpp-version`
12 if [ "${VERSION}" != 'RELEASE' ]; then
13     if [ "${OS}" == "centos7" ]; then
14         VERSION="${VERSION}.x86_64"
15     else
16         VERSION="${VERSION}_amd64"
17     fi
18 fi
19
20 if [ "${OS}" == "ubuntu1604" ]; then
21     OS_PART="ubuntu.xenial.main"
22     PACKAGE="deb deb.md5"
23     CLASS="deb"
24 elif [ "${OS}" == "centos7" ]; then
25     OS_PART="centos7"
26     PACKAGE="rpm rpm.md5"
27     CLASS=""
28 fi
29
30 if [ "${STREAM}" == "master" ]; then
31     STREAM_PART="master"
32 else
33     STREAM_PART="stable.${STREAM}"
34 fi
35
36 REPO="fd.io.${STREAM_PART}.${OS_PART}"
37
38 for ART in ${ARTIFACTS}; do
39     for PAC in ${PACKAGE}; do
40         curl "${URL}?r=${REPO}&g=${GROUP}&a=${ART}&p=${PAC}&v=${VERSION}&c=${CLASS}" -O -J || exit
41     done
42 done
43
44 # verify downloaded package
45 if [ "${OS}" == "centos7" ]; then
46     FILES=*.rpm
47 else
48     FILES=*.deb
49 fi
50
51 for FILE in ${FILES}; do
52     echo " "${FILE} >> ${FILE}.md5
53 done
54 for MD5FILE in *.md5; do
55     md5sum -c ${MD5FILE} || exit
56     rm ${MD5FILE}
57 done
58
59 # install vpp-api-java, this extracts jvpp .jar files into usr/share/java
60 if [ "${OS}" == "centos7" ]; then
61     sudo rpm --nodeps --install vpp-api-java*
62 else
63     sudo dpkg --ignore-depends=vpp --install vpp-api-java*
64 fi
65 rm vpp-api-java*
66
67 # install jvpp jars into maven repo, so that maven picks them up when building hc2vpp
68 version=`./jvpp-version`
69
70 current_dir=`pwd`
71 cd /usr/share/java
72
73 for item in jvpp*.jar; do
74     # Example filename: jvpp-registry-17.01-20161206.125556-1.jar
75     # ArtifactId = jvpp-registry
76     # Version = 17.01
77     basefile=$(basename -s .jar "$item")
78     artifactId=$(echo "$basefile" | cut -d '-' -f 1-2)
79     mvn install:install-file -Dfile=${item} -DgroupId=io.fd.vpp -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=jar -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
80 done
81
82 cd ${current_dir}