Merge pull request #76 from markgoddard/travis-test
Use a build matrix for TravisCI tests
This commit is contained in:
commit
9f4499e4b6
24
.travis.yml
24
.travis.yml
@ -2,7 +2,7 @@
|
|||||||
language: python
|
language: python
|
||||||
python: "2.7"
|
python: "2.7"
|
||||||
|
|
||||||
# Use the new container infrastructure
|
# Run jobs in containers.
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
# Install ansible
|
# Install ansible
|
||||||
@ -11,18 +11,24 @@ addons:
|
|||||||
packages:
|
packages:
|
||||||
- gcc
|
- gcc
|
||||||
- python-virtualenv
|
- python-virtualenv
|
||||||
|
- realpath
|
||||||
|
|
||||||
|
# Create a build matrix for the different test jobs.
|
||||||
|
env:
|
||||||
|
matrix:
|
||||||
|
# Run python style checks.
|
||||||
|
- TOX_ENV=pep8
|
||||||
|
# Build documentation.
|
||||||
|
- TOX_ENV=docs
|
||||||
|
# Run python2.7 unit tests.
|
||||||
|
- TOX_ENV=py27
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
# Install a virtualenv for tox.
|
||||||
- virtualenv venv
|
- virtualenv venv
|
||||||
- venv/bin/pip install -U pip
|
- venv/bin/pip install -U pip
|
||||||
- venv/bin/pip install tox
|
- venv/bin/pip install tox
|
||||||
|
|
||||||
script:
|
script:
|
||||||
# Run python style checks.
|
# Run the tox environment.
|
||||||
- venv/bin/tox -e pep8
|
- venv/bin/tox -e ${TOX_ENV}
|
||||||
|
|
||||||
# Build documentation.
|
|
||||||
- venv/bin/tox -e docs
|
|
||||||
|
|
||||||
# Run python2.7 unit tests.
|
|
||||||
- venv/bin/tox -e py27
|
|
||||||
|
@ -1,77 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
function configure_kayobe {
|
|
||||||
KAYOBE_CONFIG_PATH=${KAYOBE_CONFIG_PATH:-/etc/kayobe}
|
|
||||||
sudo yum -y install python-netaddr
|
|
||||||
sudo mkdir -p ${KAYOBE_CONFIG_PATH}
|
|
||||||
sudo chown ${USER}:${USER} ${KAYOBE_CONFIG_PATH}
|
|
||||||
chmod 755 ${KAYOBE_CONFIG_PATH}
|
|
||||||
cp -r etc/kayobe/* ${KAYOBE_CONFIG_PATH}
|
|
||||||
my_interface=$(ip route get 8.8.8.8 | awk '{ print $5 }')
|
|
||||||
my_ip=$(ip route get 8.8.8.8 | awk '{ print $7 }')
|
|
||||||
gateway=$(ip route get 8.8.8.8 | awk '{ print $3 }')
|
|
||||||
cidr=$(ip a show $my_interface | awk '$1 == "inet" { print $2 }')
|
|
||||||
vip=$(python -c "import netaddr; a = netaddr.IPAddress('$my_ip'); print a+2")
|
|
||||||
cat >> ${KAYOBE_CONFIG_PATH}/ntp.yml << EOF
|
|
||||||
|
|
||||||
#######################################################
|
|
||||||
# Local config
|
|
||||||
timezone: GMT
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat >> ${KAYOBE_CONFIG_PATH}/networks.yml << EOF
|
|
||||||
|
|
||||||
#######################################################
|
|
||||||
# Local config
|
|
||||||
provision_oc_net_name: 'the_net'
|
|
||||||
provision_wl_net_name: 'the_net'
|
|
||||||
internal_net_name: 'the_net'
|
|
||||||
public_net_name: 'the_net'
|
|
||||||
external_net_name: 'the_net'
|
|
||||||
storage_net_name: 'the_net'
|
|
||||||
storage_mgmt_net_name: 'the_net'
|
|
||||||
|
|
||||||
the_net_vip_address: ${vip}
|
|
||||||
the_net_cidr: ${cidr}
|
|
||||||
the_net_gateway: ${gateway}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat > ${KAYOBE_CONFIG_PATH}/network-allocation.yml << EOF
|
|
||||||
---
|
|
||||||
the_net_ips:
|
|
||||||
localhost: ${my_ip}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat > ${KAYOBE_CONFIG_PATH}/inventory/hosts << EOF
|
|
||||||
[config-mgmt]
|
|
||||||
# This host acts as the configuration management control host. This must be
|
|
||||||
# localhost.
|
|
||||||
localhost ansible_connection=local
|
|
||||||
|
|
||||||
[seed]
|
|
||||||
# This host will provide the Bifrost undercloud.
|
|
||||||
localhost ansible_host=127.0.0.1
|
|
||||||
|
|
||||||
[controllers]
|
|
||||||
# These hosts will provide the OpenStack overcloud.
|
|
||||||
EOF
|
|
||||||
|
|
||||||
if [[ -e ~/kayobe-env ]] ; then
|
|
||||||
for controller_ip in $(python -c "import json
|
|
||||||
with open('/home/centos/kayobe-env') as f:
|
|
||||||
cfg = json.load(f)
|
|
||||||
for ctl_ip in cfg['controller_ips']:
|
|
||||||
print ctl_ip"); do
|
|
||||||
echo " '$controller_ip': $controller_ip" >> ${KAYOBE_CONFIG_PATH}/network-allocation.yml
|
|
||||||
echo $controller_ip >> ${KAYOBE_CONFIG_PATH}/inventory/hosts
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function main {
|
|
||||||
configure_kayobe
|
|
||||||
}
|
|
||||||
|
|
||||||
main $@
|
|
Loading…
Reference in New Issue
Block a user