From 6ab4c3082e048f252970c5167804a2a4e6b4f9c6 Mon Sep 17 00:00:00 2001 From: gardlt Date: Mon, 13 Feb 2017 20:56:05 -0600 Subject: [PATCH] [travis-ci] adding-pipeline-for-testing * added travis file * updated README.md * added linting and tox --- .travis.yml | 28 ++++++++++++++++++++++++++++ README.md | 15 +++++++++------ setup.py | 38 +++++++++++++++++++++++++++----------- test-requirements.txt | 2 ++ tox.ini | 14 ++++++++++++++ 5 files changed, 80 insertions(+), 17 deletions(-) create mode 100644 .travis.yml create mode 100644 test-requirements.txt create mode 100644 tox.ini diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..f32125b9 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,28 @@ +language: python + +sudo: required + +python: + - "2.7" + - "3.6" + +before_install: + - export LIGGIT2_VERSION=0.24.0 + - export LIBGIT2=$VIRTUAL_ENV + - wget https://github.com/libgit2/libgit2/archive/v${LIGGIT2_VERSION}.tar.gz + - tar xzf v${LIGGIT2_VERSION}.tar.gz + - cd libgit2-${LIGGIT2_VERSION}/ + - cmake . -DCMAKE_INSTALL_PREFIX=$LIBGIT2 + - make + - make install + - export LDFLAGS="-Wl,-rpath='$LIBGIT2/lib',--enable-new-dtags $LDFLAGS" + - cd .. + - pip install -r test-requirements.txt + - pip install -r requirements.txt + # - flake8 + +install: + - pip install . + +script: + - armada -c examples/armada.yaml diff --git a/README.md b/README.md index 4700b3f6..c5773d2b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ # Armada + +[![Build Status](https://travis-ci.org/att-comdev/armada.svg?branch=master)](https://travis-ci.org/att-comdev/armada) + A python orchestrator for a installing, upgrading, and managing a collection of helm charts, dependencies, and values overrides. -Note that this project is pre-alpha and under active development. It may undergo drastic changes to support the long-term vision but contributions are welcome. +Note that this project is pre-alpha and under active development. It may undergo drastic changes to support the long-term vision but contributions are welcome. # Overview @@ -26,13 +29,13 @@ The installation is fairly straight forward: To run armada, simply supply it with your YAML based intention for any number of charts: ``` - ~/armada-env/bin/aramda -c examples/aramda.conf + ~/armada-env/bin/aramda -c examples/armada.yaml ``` Your output will look something like this: ``` -$ ~/armada-env/bin/armada -c examples/armada.yaml +$ ~/armada-env/bin/armada -c examples/armada.yaml 2017-02-10 09:42:36,753 armada INFO Cloning git://github.com/att-comdev/openstack-helm/keystone for release keystone 2017-02-10 09:42:39,238 armada INFO Building dependency chart common for release keystone 2017-02-10 09:42:39,238 armada INFO Cloning git://github.com/att-comdev/openstack-helm/common for release None @@ -59,15 +62,15 @@ endpoints: &endpoints And re-run armada, we will notice it will upgrade the keystone release, instead of install it on this pass, as well as report back the values changes as a unified diff. A unified diff for any template changes would also be shown had those occurred. ``` -alan@hpdesktop:~/Workbench/att/attcomdev/armada$ /tmp/armada/bin/armada -c examples/armada.yaml +alan@hpdesktop:~/Workbench/att/attcomdev/armada$ /tmp/armada/bin/armada -c examples/armada.yaml 2017-02-10 09:44:43,396 armada INFO Cloning git://github.com/att-comdev/openstack-helm/keystone for release keystone 2017-02-10 09:44:47,640 armada INFO Building dependency chart common for release keystone 2017-02-10 09:44:47,640 armada INFO Cloning git://github.com/att-comdev/openstack-helm/common for release None 2017-02-10 09:44:49,701 armada INFO Upgrading release keystone 2017-02-10 09:44:49,704 armada INFO Values Unified Diff (keystone) ---- +--- -+++ ++++ @@ -1,3 +1,3 @@ diff --git a/setup.py b/setup.py index 78d39c3b..9724e9bb 100755 --- a/setup.py +++ b/setup.py @@ -1,15 +1,31 @@ from setuptools import setup +from setuptools.command.test import test as TestCommand +import sys + +class Tox(TestCommand): + """Runs Tox comands""" + def finalize_options(self): + """preps test suite""" + TestCommand.finalize_options(self) + self.test_args = [] + self.test_suite = True + + def run_tests(self): + """runs test suite""" + import tox + errcode = tox.cmdline(self.test_args) + sys.exit(errcode) + setup( - name = 'armada', - version = '0.1.0', - description = 'Armada Helm Orchestrator', - packages = ['armada', - 'hapi', - 'hapi.chart', - 'hapi.release', - 'hapi.services', - 'hapi.version' - ], - scripts = ['scripts/armada'] + name='armada', + version='0.1.0', + description='Armada Helm Orchestrator', + packages=['armada', + 'hapi', + 'hapi.chart', + 'hapi.release', + 'hapi.services', + 'hapi.version'], + scripts=['scripts/armada'] ) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 00000000..90185032 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,2 @@ +flake8==3.3.0 +tox==2.6.0 diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..3fda7bad --- /dev/null +++ b/tox.ini @@ -0,0 +1,14 @@ +[tox] +envlist = py27 + +[testenv] +deps= + -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +setenv= + PYTHONWARNINGS=all + +[flake8] +ignore=E302,H306 +exclude= libgit2-0.24.0, .git, .idea, .tox, *.egg-info, *.eggs, bin, dist +