Fix MOS 10.0 support
Factorize duplicated code for packages download Add missing Copyright to pre_build_hook shell script Fix packages versions for MOS 10.0 Add extra packages and second repository for Xenial Change-Id: I5360519d542ab5551c8d0951a722aa132e38da7c
This commit is contained in:
parent
162ae0504f
commit
7cbe8725a0
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,6 +2,7 @@
|
||||
zabbix_monitoring*.noarch.rpm
|
||||
repositories/centos/*.rpm
|
||||
repositories/ubuntu/*.deb
|
||||
repositories/ubuntu/*/*.deb
|
||||
.bundled_gems/
|
||||
.bundle/
|
||||
Gemfile.lock
|
||||
|
15
functions.sh
15
functions.sh
@ -17,22 +17,14 @@ set -eux
|
||||
|
||||
ROOT="$(dirname "$(readlink -f "$0")")"
|
||||
MODULES_DIR="${ROOT}"/deployment_scripts/puppet/modules
|
||||
RPM_REPO="${ROOT}"/repositories/centos/
|
||||
DEB_REPO="${ROOT}"/repositories/ubuntu/
|
||||
|
||||
# Download RPM or DEB packages and store them in the local repository directory
|
||||
function download_package {
|
||||
REPO="$1"
|
||||
shift
|
||||
while [ $# -gt 0 ]; do
|
||||
if [[ "$1" == *.deb ]]; then
|
||||
REPO=$DEB_REPO
|
||||
elif [[ "$1" == *.rpm ]]; then
|
||||
REPO=$RPM_REPO
|
||||
else
|
||||
echo "Invalid URL for download_package(): $1"
|
||||
fi
|
||||
|
||||
FILE=$(basename "$1")
|
||||
wget -qO - "$1" > "$REPO"/"$FILE"
|
||||
wget -qO "$REPO"/"$FILE" "$1"
|
||||
shift
|
||||
done
|
||||
}
|
||||
@ -43,4 +35,3 @@ function download_puppet_module {
|
||||
mkdir -p "${MODULES_DIR}"/"$1"
|
||||
wget -qO- "$2" | tar -C "${MODULES_DIR}/$1" --strip-components=1 -xz
|
||||
}
|
||||
|
||||
|
@ -22,27 +22,27 @@ releases:
|
||||
version: 2015.1.0-7.0
|
||||
mode: ['ha']
|
||||
deployment_scripts_path: deployment_scripts/
|
||||
repository_path: repositories/ubuntu
|
||||
repository_path: repositories/ubuntu/trusty
|
||||
- os: ubuntu
|
||||
version: liberty-8.0
|
||||
mode: ['ha']
|
||||
deployment_scripts_path: deployment_scripts/
|
||||
repository_path: repositories/ubuntu
|
||||
repository_path: repositories/ubuntu/trusty
|
||||
- os: ubuntu
|
||||
version: liberty-9.0
|
||||
mode: ['ha']
|
||||
deployment_scripts_path: deployment_scripts/
|
||||
repository_path: repositories/ubuntu
|
||||
repository_path: repositories/ubuntu/trusty
|
||||
- os: ubuntu
|
||||
version: mitaka-9.0
|
||||
mode: ['ha']
|
||||
deployment_scripts_path: deployment_scripts/
|
||||
repository_path: repositories/ubuntu
|
||||
repository_path: repositories/ubuntu/trusty
|
||||
- os: ubuntu
|
||||
version: newton-10.0
|
||||
mode: ['ha']
|
||||
deployment_scripts_path: deployment_scripts/
|
||||
repository_path: repositories/ubuntu
|
||||
repository_path: repositories/ubuntu/xenial
|
||||
|
||||
# Version of plugin package
|
||||
package_version: '3.0.0'
|
||||
|
100
pre_build_hook
100
pre_build_hook
@ -1,7 +1,21 @@
|
||||
#!/bin/bash
|
||||
# Copyright 2017 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set -eux
|
||||
|
||||
ROOT="$(dirname `readlink -f $0`)"
|
||||
ROOT="$(dirname "$(readlink -f "$0")")"
|
||||
|
||||
. "${ROOT}"/functions.sh
|
||||
|
||||
@ -10,47 +24,55 @@ ROOT="$(dirname `readlink -f $0`)"
|
||||
PHPFPM_TARBALL_URL="https://forgeapi.puppetlabs.com/v3/files/Slashbunny-phpfpm-0.0.8.tar.gz"
|
||||
|
||||
RPM_REPO="${ROOT}"/repositories/centos/
|
||||
DEB_REPO="${ROOT}"/repositories/ubuntu/
|
||||
mkdir -p $RPM_REPO
|
||||
mkdir -p $DEB_REPO
|
||||
DEB_TRUSTY_REPO="${ROOT}"/repositories/ubuntu/trusty
|
||||
DEB_XENIAL_REPO="${ROOT}"/repositories/ubuntu/xenial
|
||||
mkdir -p $RPM_REPO $DEB_TRUSTY_REPO $DEB_XENIAL_REPO
|
||||
|
||||
# Downloads needed RPM or DEB packages
|
||||
function download {
|
||||
case "$1" in
|
||||
deb) REPO=$DEB_REPO;;
|
||||
rpm) REPO=$RPM_REPO;;
|
||||
esac
|
||||
shift
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
FILE=$(basename "$1")
|
||||
wget -qO - $1 > "$REPO/$FILE"
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
PHP5_VERSION="5.5.9+dfsg-1ubuntu4.20"
|
||||
PHP5_TRUSTY_VERSION="5.5.9+dfsg-1ubuntu4.21"
|
||||
PHP5_XENIAL_VERSION="5.6.4+dfsg-4ubuntu6.4"
|
||||
ZBX_VERSION="2.4.8-1+trusty"
|
||||
|
||||
download deb http://repo.zabbix.com/zabbix/2.4/ubuntu/pool/main/z/zabbix/zabbix-agent_${ZBX_VERSION}_amd64.deb \
|
||||
http://repo.zabbix.com/zabbix/2.4/ubuntu/pool/main/z/zabbix/zabbix-frontend-php_${ZBX_VERSION}_all.deb \
|
||||
http://repo.zabbix.com/zabbix/2.4/ubuntu/pool/main/z/zabbix/zabbix-server-mysql_${ZBX_VERSION}_amd64.deb \
|
||||
http://repo.zabbix.com/zabbix/2.4/ubuntu/pool/main/z/zabbix/zabbix-sender_${ZBX_VERSION}_amd64.deb \
|
||||
http://repo.zabbix.com/zabbix/2.4/ubuntu/pool/main/z/zabbix/zabbix-get_${ZBX_VERSION}_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/p/php5/php5_${PHP5_VERSION}_all.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/p/php5/php5-mysql_${PHP5_VERSION}_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/p/php5/php5-common_${PHP5_VERSION}_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/p/php5/php5-gd_${PHP5_VERSION}_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/p/php-json/php5-json_1.3.2-2build1_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/universe/p/php5/php5-fpm_${PHP5_VERSION}_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/libc/libconfig-inifiles-perl/libconfig-inifiles-perl_2.82-1_all.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/universe/libs/libsmi/smistrip_0.4.8+dfsg2-8ubuntu2_all.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/multiverse/s/snmp-mibs-downloader/snmp-mibs-downloader_1.1_all.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/universe/i/iptstate/iptstate_2.2.5-1_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/universe/libi/libiksemel/libiksemel3_1.2-4.2_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/f/fonts-dejavu/fonts-dejavu_2.34-1ubuntu1_all.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/f/fonts-dejavu/ttf-dejavu-core_2.34-1ubuntu1_all.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/f/fonts-dejavu/fonts-dejavu-extra_2.34-1ubuntu1_all.deb
|
||||
ZABBIX_PACKAGES="http://repo.zabbix.com/zabbix/2.4/ubuntu/pool/main/z/zabbix/zabbix-agent_${ZBX_VERSION}_amd64.deb \
|
||||
http://repo.zabbix.com/zabbix/2.4/ubuntu/pool/main/z/zabbix/zabbix-frontend-php_${ZBX_VERSION}_all.deb \
|
||||
http://repo.zabbix.com/zabbix/2.4/ubuntu/pool/main/z/zabbix/zabbix-server-mysql_${ZBX_VERSION}_amd64.deb \
|
||||
http://repo.zabbix.com/zabbix/2.4/ubuntu/pool/main/z/zabbix/zabbix-sender_${ZBX_VERSION}_amd64.deb \
|
||||
http://repo.zabbix.com/zabbix/2.4/ubuntu/pool/main/z/zabbix/zabbix-get_${ZBX_VERSION}_amd64.deb"
|
||||
|
||||
COMMON_PACKAGES="http://archive.ubuntu.com/ubuntu/pool/main/libc/libconfig-inifiles-perl/libconfig-inifiles-perl_2.82-1_all.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/universe/libs/libsmi/smistrip_0.4.8+dfsg2-8ubuntu2_all.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/multiverse/s/snmp-mibs-downloader/snmp-mibs-downloader_1.1_all.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/universe/i/iptstate/iptstate_2.2.5-1_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/universe/libi/libiksemel/libiksemel3_1.2-4.2_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/f/fonts-dejavu/fonts-dejavu_2.34-1ubuntu1_all.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/f/fonts-dejavu/ttf-dejavu-core_2.34-1ubuntu1_all.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/f/fonts-dejavu/fonts-dejavu-extra_2.34-1ubuntu1_all.deb"
|
||||
|
||||
PHP5_TRUSTY_PACKAGES="http://archive.ubuntu.com/ubuntu/pool/main/p/php5/php5_${PHP5_TRUSTY_VERSION}_all.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/p/php5/php5-mysql_${PHP5_TRUSTY_VERSION}_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/p/php5/php5-common_${PHP5_TRUSTY_VERSION}_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/p/php5/php5-gd_${PHP5_TRUSTY_VERSION}_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/universe/p/php5/php5-fpm_${PHP5_TRUSTY_VERSION}_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/p/php-json/php5-json_1.3.2-2build1_amd64.deb"
|
||||
|
||||
download_package "$DEB_TRUSTY_REPO" $ZABBIX_PACKAGES \
|
||||
$PHP5_TRUSTY_PACKAGES \
|
||||
$COMMON_PACKAGES
|
||||
|
||||
PHP5_XENIAL_PACKAGES="http://archive.ubuntu.com/ubuntu/pool/main/p/php5/php5_${PHP5_XENIAL_VERSION}_all.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/p/php5/php5-mysql_${PHP5_XENIAL_VERSION}_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/p/php5/php5-common_${PHP5_XENIAL_VERSION}_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/p/php5/php5-gd_${PHP5_XENIAL_VERSION}_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/p/php5/php5-cli_${PHP5_XENIAL_VERSION}_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/universe/p/php5/php5-fpm_${PHP5_XENIAL_VERSION}_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/p/php-json/php5-json_1.3.6-1build1_amd64.deb"
|
||||
|
||||
download_package "$DEB_XENIAL_REPO" $ZABBIX_PACKAGES \
|
||||
$PHP5_XENIAL_PACKAGES \
|
||||
$COMMON_PACKAGES \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/m/mysql-5.5/libmysqlclient18_5.5.54-0ubuntu0.14.04.1_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/libg/libgcrypt11/libgcrypt11_1.5.3-2ubuntu4.4_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/g/gnutls26/libgnutls26_2.12.23-12ubuntu2.6_amd64.deb \
|
||||
http://archive.ubuntu.com/ubuntu/pool/main/s/systemd/libsystemd-daemon0_204-5ubuntu20.24_amd64.deb
|
||||
|
||||
# Install puppet manifests
|
||||
download_puppet_module "phpfpm" "$PHPFPM_TARBALL_URL"
|
||||
|
0
repositories/ubuntu/trusty/.gitkeep
Normal file
0
repositories/ubuntu/trusty/.gitkeep
Normal file
0
repositories/ubuntu/xenial/.gitkeep
Normal file
0
repositories/ubuntu/xenial/.gitkeep
Normal file
2
tox.ini
2
tox.ini
@ -35,7 +35,7 @@ whitelist_externals=
|
||||
commands =
|
||||
rm -rf .build
|
||||
bash -c 'rm -rf doc/*/build'
|
||||
bash -c 'rm -rf repositories/ubuntu/*.deb repositories/centos/*.rpm'
|
||||
bash -c 'rm -rf repositories/ubuntu/*.deb repositories/ubuntu/trusty/*.deb repositories/ubuntu/xenial/*.deb repositories/centos/*.rpm'
|
||||
fpb --check {toxinidir} --debug
|
||||
fpb --build {toxinidir} --debug
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user