Browse Source

Add parametrization of plugin build

Change-Id: I50936139db1293490a831bbcccda26a341b269ae
Olivier Bourdon 2 years ago
parent
commit
19db9a3209
2 changed files with 32 additions and 9 deletions
  1. 31
    9
      pre_build_hook
  2. 1
    0
      tox.ini

+ 31
- 9
pre_build_hook View File

@@ -21,7 +21,7 @@ ROOT="$(dirname "$(readlink -f "$0")")"
21 21
 
22 22
 # Puppet manifests
23 23
 # Dependency for PHP-FPM
24
-PHPFPM_TARBALL_URL="https://forgeapi.puppetlabs.com/v3/files/Slashbunny-phpfpm-0.0.8.tar.gz"
24
+PHPFPM_TARBALL_URL="https://forgeapi.puppetlabs.com/v3/files/Slashbunny-phpfpm-0.0.13.tar.gz"
25 25
 
26 26
 RPM_REPO="${ROOT}"/repositories/centos/
27 27
 DEB_TRUSTY_REPO="${ROOT}"/repositories/ubuntu/trusty
@@ -30,13 +30,35 @@ mkdir -p $RPM_REPO $DEB_TRUSTY_REPO $DEB_XENIAL_REPO
30 30
 
31 31
 PHP5_TRUSTY_VERSION="5.5.9+dfsg-1ubuntu4.21"
32 32
 PHP5_XENIAL_VERSION="5.6.4+dfsg-4ubuntu6.4"
33
-ZBX_VERSION="2.4.8-1+trusty"
34 33
 
35
-ZABBIX_PACKAGES="http://repo.zabbix.com/zabbix/2.4/ubuntu/pool/main/z/zabbix/zabbix-agent_${ZBX_VERSION}_amd64.deb \
36
-                 http://repo.zabbix.com/zabbix/2.4/ubuntu/pool/main/z/zabbix/zabbix-frontend-php_${ZBX_VERSION}_all.deb \
37
-                 http://repo.zabbix.com/zabbix/2.4/ubuntu/pool/main/z/zabbix/zabbix-server-mysql_${ZBX_VERSION}_amd64.deb \
38
-                 http://repo.zabbix.com/zabbix/2.4/ubuntu/pool/main/z/zabbix/zabbix-sender_${ZBX_VERSION}_amd64.deb \
39
-                 http://repo.zabbix.com/zabbix/2.4/ubuntu/pool/main/z/zabbix/zabbix-get_${ZBX_VERSION}_amd64.deb"
34
+ZABBIX_VERSION=${ZABBIX_VERSION:-2.2}
35
+case $ZABBIX_VERSION in
36
+	2.2)
37
+		ZBX_MAJOR_VERSION="2.2"
38
+		ZBX_TRUSTY_VERSION=${ZBX_MAJOR_VERSION}".17-1+trusty"
39
+		ZBX_XENIAL_VERSION=${ZBX_MAJOR_VERSION}".17-1+trusty"
40
+		;;
41
+	2.4)
42
+		ZBX_MAJOR_VERSION="2.4"
43
+		ZBX_TRUSTY_VERSION=${ZBX_MAJOR_VERSION}".8-1+trusty"
44
+		ZBX_XENIAL_VERSION=${ZBX_MAJOR_VERSION}".8-1+trusty"
45
+		;;
46
+	*)
47
+		echo "Unsupported version $ZABBIX_VERSION"
48
+		exit 1
49
+esac
50
+
51
+ZABBIX_TRUSTY_PACKAGES="http://repo.zabbix.com/zabbix/$ZBX_MAJOR_VERSION/ubuntu/pool/main/z/zabbix/zabbix-agent_${ZBX_TRUSTY_VERSION}_amd64.deb \
52
+                 http://repo.zabbix.com/zabbix/$ZBX_MAJOR_VERSION/ubuntu/pool/main/z/zabbix/zabbix-frontend-php_${ZBX_TRUSTY_VERSION}_all.deb \
53
+                 http://repo.zabbix.com/zabbix/$ZBX_MAJOR_VERSION/ubuntu/pool/main/z/zabbix/zabbix-server-mysql_${ZBX_TRUSTY_VERSION}_amd64.deb \
54
+                 http://repo.zabbix.com/zabbix/$ZBX_MAJOR_VERSION/ubuntu/pool/main/z/zabbix/zabbix-sender_${ZBX_TRUSTY_VERSION}_amd64.deb \
55
+                 http://repo.zabbix.com/zabbix/$ZBX_MAJOR_VERSION/ubuntu/pool/main/z/zabbix/zabbix-get_${ZBX_TRUSTY_VERSION}_amd64.deb"
56
+
57
+ZABBIX_XENIAL_PACKAGES="http://repo.zabbix.com/zabbix/$ZBX_MAJOR_VERSION/ubuntu/pool/main/z/zabbix/zabbix-agent_${ZBX_XENIAL_VERSION}_amd64.deb \
58
+                 http://repo.zabbix.com/zabbix/$ZBX_MAJOR_VERSION/ubuntu/pool/main/z/zabbix/zabbix-frontend-php_${ZBX_XENIAL_VERSION}_all.deb \
59
+                 http://repo.zabbix.com/zabbix/$ZBX_MAJOR_VERSION/ubuntu/pool/main/z/zabbix/zabbix-server-mysql_${ZBX_XENIAL_VERSION}_amd64.deb \
60
+                 http://repo.zabbix.com/zabbix/$ZBX_MAJOR_VERSION/ubuntu/pool/main/z/zabbix/zabbix-sender_${ZBX_XENIAL_VERSION}_amd64.deb \
61
+                 http://repo.zabbix.com/zabbix/$ZBX_MAJOR_VERSION/ubuntu/pool/main/z/zabbix/zabbix-get_${ZBX_XENIAL_VERSION}_amd64.deb"
40 62
 
41 63
 COMMON_PACKAGES="http://archive.ubuntu.com/ubuntu/pool/main/libc/libconfig-inifiles-perl/libconfig-inifiles-perl_2.82-1_all.deb \
42 64
                  http://archive.ubuntu.com/ubuntu/pool/universe/libs/libsmi/smistrip_0.4.8+dfsg2-8ubuntu2_all.deb \
@@ -54,7 +76,7 @@ PHP5_TRUSTY_PACKAGES="http://archive.ubuntu.com/ubuntu/pool/main/p/php5/php5_${P
54 76
                       http://archive.ubuntu.com/ubuntu/pool/universe/p/php5/php5-fpm_${PHP5_TRUSTY_VERSION}_amd64.deb \
55 77
                       http://archive.ubuntu.com/ubuntu/pool/main/p/php-json/php5-json_1.3.2-2build1_amd64.deb"
56 78
              
57
-download_package "$DEB_TRUSTY_REPO" $ZABBIX_PACKAGES \
79
+download_package "$DEB_TRUSTY_REPO" $ZABBIX_TRUSTY_PACKAGES \
58 80
              $PHP5_TRUSTY_PACKAGES \
59 81
              $COMMON_PACKAGES
60 82
 
@@ -66,7 +88,7 @@ PHP5_XENIAL_PACKAGES="http://archive.ubuntu.com/ubuntu/pool/main/p/php5/php5_${P
66 88
                       http://archive.ubuntu.com/ubuntu/pool/universe/p/php5/php5-fpm_${PHP5_XENIAL_VERSION}_amd64.deb \
67 89
                       http://archive.ubuntu.com/ubuntu/pool/main/p/php-json/php5-json_1.3.6-1build1_amd64.deb"
68 90
 
69
-download_package "$DEB_XENIAL_REPO" $ZABBIX_PACKAGES \
91
+download_package "$DEB_XENIAL_REPO" $ZABBIX_XENIAL_PACKAGES \
70 92
              $PHP5_XENIAL_PACKAGES \
71 93
              $COMMON_PACKAGES \
72 94
              http://archive.ubuntu.com/ubuntu/pool/main/m/mysql-5.5/libmysqlclient18_5.5.54-0ubuntu0.14.04.1_amd64.deb \

+ 1
- 0
tox.ini View File

@@ -28,6 +28,7 @@ commands =
28 28
 
29 29
 [testenv:build_plugin]
30 30
 changedir = {toxinidir}
31
+passenv = ZABBIX_VERSION
31 32
 whitelist_externals=
32 33
     fpb
33 34
     rm

Loading…
Cancel
Save