diff options
| author | Joshua Powers <josh.powers@canonical.com> | 2017-06-01 16:39:50 -0700 |
|---|---|---|
| committer | Scott Moser <smoser@brickies.net> | 2017-06-08 15:32:25 -0400 |
| commit | ee324391bcb436b1d3a1c44951aa1aa673005cf6 (patch) | |
| tree | 18a3d6fb1df19d27bbba9f3569bdadc3b56b3450 /tools/setup-centos | |
| parent | f8f519aa63c8e8adb11fa45b85f7264cd84fe796 (diff) | |
| download | vyos-cloud-init-ee324391bcb436b1d3a1c44951aa1aa673005cf6.tar.gz vyos-cloud-init-ee324391bcb436b1d3a1c44951aa1aa673005cf6.zip | |
tools: add centos scripts to build and test
The added 'run-centos' does:
- Creates centos 6 or 7 lxd container
* Sets http_proxy variable for yum if set locally
* Creates centos user
- Push local tree
* Tar's up working directory
* Pushes to container and untars
- Installs pip and yum dependencies
- As user centos it can then based on flags:
* runs unittests
* run ./packages/brpm
* run ./packages/brpm --srpm
* artifact the built *.rpm
Diffstat (limited to 'tools/setup-centos')
| -rwxr-xr-x | tools/setup-centos | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tools/setup-centos b/tools/setup-centos new file mode 100755 index 00000000..bc5da8a7 --- /dev/null +++ b/tools/setup-centos @@ -0,0 +1,49 @@ +#!/bin/sh +# This file is part of cloud-init. See LICENSE file for license information. +set -fux +export LANG=C + +packages=" + file + git + pyserial + python-argparse + python-cheetah + python-configobj + python-devel + python-jinja2 + python-jsonpatch + python-oauthlib + python-pip + python-prettytable + python-requests + python-six + PyYAML + rpm-build +" + +pips=" + contextlib2 + httpretty + mock + nose + pep8 + unittest2 +" + +error() { echo "$@" 1>&2; } +fail() { [ $# -eq 0 ] || error "$@"; exit 1; } +info() { echo "$@"; } + +pips=$(for p in $pips; do echo "$p"; done | sort -u) +packages=$(for p in $packages; do echo "$p"; done | sort -u) + +if ! rpm -q epel-release >/dev/null; then + yum install --assumeyes epel-release || + fail "failed: yum install epel-release" +fi +yum install --assumeyes $packages || + fail "failed: yum install" "$packages" + +pip install --upgrade $pips || + fail "failed: pip install $pips" |
