4 # In case of master branch, update vpp_dependencies file
5 # to match vpp-api-java and eliminate Java API mismatches (HC2VPP-102).
7 # In order to have control of package dependencies in the release artifacts (HC2VPP-282),
8 # the vpp_dependencies file is not modified in case of stable branch
9 # (after VPP API freeze, Java API mismatches occur very rarely).
10 if [[ "${STREAM}" == "master" ]]; then
11 if [[ "${OS}" == "centos7" ]]; then
12 # Determine VPP Java API version used in maven build
13 JVPP_VERSION=`yum list installed vpp-api-java | grep vpp-api-java | awk '{ printf $2; }'`
14 VERSION=`yum deplist vpp-api-java |grep vpp-lib |head -1 | awk '{ print $3}'`
16 # Write a file that will echo VPP dependencies
17 echo -n 'echo' > vpp_dependencies
18 echo " \"vpp = ${VERSION}, vpp-plugins = ${VERSION}, vpp-api-java = ${JVPP_VERSION}\"" >> vpp_dependencies
19 chmod +x vpp_dependencies
21 # Overwrite default dependencies file
22 mv vpp_dependencies packaging/rpm/
24 # Determine VPP Java API version used in maven build
25 JVPP_VERSION=`apt list --installed | grep vpp-api-java | awk '{ printf $2; }'`
26 # get vpp-api-java package dependencies
27 JVPP_DEPS=`apt-cache show vpp-api-java=${JVPP_VERSION} |grep Depends: | sed "s/Depends: //"`
28 # separate deps with newline, then find VPP dependency and filter out the version
29 VERSION=`echo ${JVPP_DEPS}| sed "s/, /\\n/" |grep "vpp " | sed "s/).*//" |sed "s/.* //"`
31 # Write a file that will echo VPP dependencies
32 echo -n 'echo' > vpp_dependencies
33 echo " \"vpp (= ${VERSION}), vpp-plugin-core (= ${VERSION}), vpp-api-java (= ${JVPP_VERSION})\"" >> vpp_dependencies
34 chmod +x vpp_dependencies
36 # Overwrite default dependencies file
37 mv vpp_dependencies packaging/deb/common/
42 if [[ "${OS}" == "centos7" ]]; then
45 ./packaging/rpm/rpmbuild.sh
48 RPMS=$(find ./packaging/ -type f -iname '*.rpm')
49 SRPMS=$(find ./packaging/ -type f -iname '*.srpm')
50 SRCRPMS=$(find ./packaging/ -type f -name '*.src.rpm')
52 # Publish hc2vpp packages
53 for i in ${RPMS} ${SRPMS} ${SRCRPMS}
57 elif [[ "${OS}" == "ubuntu1604" ]]; then
60 ./packaging/deb/xenial/debuild.sh
63 DEBS=$(find ./packaging/ -type f -iname '*.deb')
65 # Publish hc2vpp packages
70 elif [[ "${OS}" == "ubuntu1804" ]]; then
73 ./packaging/deb/bionic/debuild.sh
76 DEBS=$(find ./packaging/ -type f -iname '*.deb')
78 # Publish hc2vpp packages