d4c2be38faf2c1e0cdd3dffc8c2dd6e7d750cc60
[ci-management.git] / jjb / hc2vpp / include-raw-hc2vpp-pkg-push.sh
1 #!/bin/bash
2 set -x
3
4 # determine VPP Java API version used in maven build
5 if [ "${OS}" == "centos7" ]; then
6     VERSION=`yum list installed vpp-api-java | grep vpp-api-java | awk '{ printf $2; }'`
7     # write a file that will echo VPP dependencies
8     echo -n 'echo' > vpp_dependencies
9     echo " \"vpp = ${VERSION}, vpp-plugins = ${VERSION}\"" >> vpp_dependencies
10     chmod +x vpp_dependencies
11     # overwrite default dependencies file
12     mv vpp_dependencies packaging/rpm/
13 else
14     VERSION=`apt list --installed | grep vpp-api-java | awk '{ printf $2; }'`
15     # write a file that will echo VPP dependencies
16     echo -n 'echo' > vpp_dependencies
17     echo " \"vpp (= ${VERSION}), vpp-plugins (= ${VERSION})\"" >> vpp_dependencies
18     chmod +x vpp_dependencies
19     # overwrite default dependencies file
20     mv vpp_dependencies packaging/deb/common/
21 fi
22
23 if [ "${OS}" == "centos7" ]; then
24
25     # Build the rpms
26     ./packaging/rpm/rpmbuild.sh
27
28     # Find the files
29     RPMS=$(find . -type f -iname '*.rpm')
30     SRPMS=$(find . -type f -iname '*.srpm')
31     SRCRPMS=$(find . -type f -name '*.src.rpm')
32     # publish hc2vpp packages
33     for i in $RPMS $SRPMS $SRCRPMS
34     do
35         push_rpm "$i"
36     done
37 elif [ "${OS}" == "ubuntu1404" ]; then
38
39     # Build the debs
40     ./packaging/deb/trusty/debuild.sh
41
42     # Find the files
43     DEBS=$(find . -type f -iname '*.deb')
44     # publish hc2vpp packages
45     for i in $DEBS
46     do
47         push_deb "$i"
48     done
49 elif [ "${OS}" == "ubuntu1604" ]; then
50
51     # Build the debs
52     ./packaging/deb/xenial/debuild.sh
53
54     # Find the files
55     DEBS=$(find . -type f -iname '*.deb')
56     # publish hc2vpp packages
57     for i in $DEBS
58     do
59         push_deb "$i"
60     done
61 fi