From b19759277492f37ac311662ac77c6a5ec164f004 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Mon, 14 Mar 2016 15:57:14 +0100 Subject: [PATCH] Minimal PR build again --- .travis.yml | 317 +++++++++++++++++++++++-------------- scripts/make_travisconf.py | 128 ++++++++------- 2 files changed, 268 insertions(+), 177 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9433c50..146165e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,116 +1,201 @@ -# Generated by scripts/make_travisconf.py - -sudo: true -language: python - -install: - - ". scripts/travis-install.sh" - - "pip install -U pip" - - "pip install wheel" - - "make -e install-dev" - - "make -e install-$BUILD" - -script: - - "make -e $BUILD" - -matrix: - include: - - python: 2.7 - env: BUILD=style - - python: 2.7 - env: BUILD=test REMOTESTORAGE_SERVER=mysteryshack REQUIREMENTS=devel - - python: 2.7 - env: BUILD=test REMOTESTORAGE_SERVER=mysteryshack REQUIREMENTS=release - - python: 2.7 - env: BUILD=test REMOTESTORAGE_SERVER=mysteryshack REQUIREMENTS=minimal - - python: 2.7 - env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=devel - - python: 2.7 - env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=release - - python: 2.7 - env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=minimal - - python: 2.7 - env: BUILD=test DAV_SERVER=owncloud REQUIREMENTS=devel - - python: 2.7 - env: BUILD=test DAV_SERVER=owncloud REQUIREMENTS=release - - python: 2.7 - env: BUILD=test DAV_SERVER=owncloud REQUIREMENTS=minimal - - python: 2.7 - env: BUILD=test DAV_SERVER=baikal REQUIREMENTS=devel - - python: 2.7 - env: BUILD=test DAV_SERVER=baikal REQUIREMENTS=release - - python: 2.7 - env: BUILD=test DAV_SERVER=baikal REQUIREMENTS=minimal - - python: 2.7 - env: BUILD=test DAV_SERVER=davical REQUIREMENTS=devel - - python: 2.7 - env: BUILD=test DAV_SERVER=davical REQUIREMENTS=release - - python: 2.7 - env: BUILD=test DAV_SERVER=davical REQUIREMENTS=minimal - - python: 3.3 - env: BUILD=style - - python: 3.3 - env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=devel - - python: 3.3 - env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=release - - python: 3.3 - env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=minimal - - python: 3.4 - env: BUILD=style - - python: 3.4 - env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=devel - - python: 3.4 - env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=release - - python: 3.4 - env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=minimal - - python: 3.5 - env: BUILD=style - - python: 3.5 - env: BUILD=test REMOTESTORAGE_SERVER=mysteryshack REQUIREMENTS=devel - - python: 3.5 - env: BUILD=test REMOTESTORAGE_SERVER=mysteryshack REQUIREMENTS=release - - python: 3.5 - env: BUILD=test REMOTESTORAGE_SERVER=mysteryshack REQUIREMENTS=minimal - - python: 3.5 - env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=devel - - python: 3.5 - env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=release - - python: 3.5 - env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=minimal - - python: 3.5 - env: BUILD=test DAV_SERVER=owncloud REQUIREMENTS=devel - - python: 3.5 - env: BUILD=test DAV_SERVER=owncloud REQUIREMENTS=release - - python: 3.5 - env: BUILD=test DAV_SERVER=owncloud REQUIREMENTS=minimal - - python: 3.5 - env: BUILD=test DAV_SERVER=baikal REQUIREMENTS=devel - - python: 3.5 - env: BUILD=test DAV_SERVER=baikal REQUIREMENTS=release - - python: 3.5 - env: BUILD=test DAV_SERVER=baikal REQUIREMENTS=minimal - - python: 3.5 - env: BUILD=test DAV_SERVER=davical REQUIREMENTS=devel - - python: 3.5 - env: BUILD=test DAV_SERVER=davical REQUIREMENTS=release - - python: 3.5 - env: BUILD=test DAV_SERVER=davical REQUIREMENTS=minimal - - python: pypy - env: BUILD=style - - python: pypy - env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=devel - - python: pypy - env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=release - - python: pypy - env: BUILD=test DAV_SERVER=radicale REQUIREMENTS=minimal - - language: generic - os: osx - env: BUILD=test - - -branches: - only: - - auto - - master - - +{ + "branches": { + "only": [ + "auto", + "master" + ] + }, + "install": [ + "if [ \"$BUILD_PRS\" = \"true\" ] || [ \"$TRAVIS_PULL_REQUEST\" = \"false\" ]; then\n . scripts/travis-install.sh;\n pip install -U pip;\n pip install wheel;\n make -e install-dev;\n make -e install-$BUILD;\nfi" + ], + "language": "python", + "matrix": { + "include": [ + { + "env": "BUILD=style BUILD_PRS=true", + "python": "2.7" + }, + { + "env": "BUILD=test REMOTESTORAGE_SERVER=mysteryshack REQUIREMENTS=devel BUILD_PRS=false", + "python": "2.7" + }, + { + "env": "BUILD=test REMOTESTORAGE_SERVER=mysteryshack REQUIREMENTS=release BUILD_PRS=false", + "python": "2.7" + }, + { + "env": "BUILD=test REMOTESTORAGE_SERVER=mysteryshack REQUIREMENTS=minimal BUILD_PRS=false", + "python": "2.7" + }, + { + "env": "BUILD=test DAV_SERVER=radicale REQUIREMENTS=devel BUILD_PRS=true", + "python": "2.7" + }, + { + "env": "BUILD=test DAV_SERVER=radicale REQUIREMENTS=release BUILD_PRS=true", + "python": "2.7" + }, + { + "env": "BUILD=test DAV_SERVER=radicale REQUIREMENTS=minimal BUILD_PRS=true", + "python": "2.7" + }, + { + "env": "BUILD=test DAV_SERVER=owncloud REQUIREMENTS=devel BUILD_PRS=false", + "python": "2.7" + }, + { + "env": "BUILD=test DAV_SERVER=owncloud REQUIREMENTS=release BUILD_PRS=false", + "python": "2.7" + }, + { + "env": "BUILD=test DAV_SERVER=owncloud REQUIREMENTS=minimal BUILD_PRS=false", + "python": "2.7" + }, + { + "env": "BUILD=test DAV_SERVER=baikal REQUIREMENTS=devel BUILD_PRS=false", + "python": "2.7" + }, + { + "env": "BUILD=test DAV_SERVER=baikal REQUIREMENTS=release BUILD_PRS=false", + "python": "2.7" + }, + { + "env": "BUILD=test DAV_SERVER=baikal REQUIREMENTS=minimal BUILD_PRS=false", + "python": "2.7" + }, + { + "env": "BUILD=test DAV_SERVER=davical REQUIREMENTS=devel BUILD_PRS=false", + "python": "2.7" + }, + { + "env": "BUILD=test DAV_SERVER=davical REQUIREMENTS=release BUILD_PRS=false", + "python": "2.7" + }, + { + "env": "BUILD=test DAV_SERVER=davical REQUIREMENTS=minimal BUILD_PRS=false", + "python": "2.7" + }, + { + "env": "BUILD=style BUILD_PRS=true", + "python": "3.3" + }, + { + "env": "BUILD=test DAV_SERVER=radicale REQUIREMENTS=devel BUILD_PRS=false", + "python": "3.3" + }, + { + "env": "BUILD=test DAV_SERVER=radicale REQUIREMENTS=release BUILD_PRS=false", + "python": "3.3" + }, + { + "env": "BUILD=test DAV_SERVER=radicale REQUIREMENTS=minimal BUILD_PRS=false", + "python": "3.3" + }, + { + "env": "BUILD=style BUILD_PRS=true", + "python": "3.4" + }, + { + "env": "BUILD=test DAV_SERVER=radicale REQUIREMENTS=devel BUILD_PRS=false", + "python": "3.4" + }, + { + "env": "BUILD=test DAV_SERVER=radicale REQUIREMENTS=release BUILD_PRS=false", + "python": "3.4" + }, + { + "env": "BUILD=test DAV_SERVER=radicale REQUIREMENTS=minimal BUILD_PRS=false", + "python": "3.4" + }, + { + "env": "BUILD=style BUILD_PRS=true", + "python": "3.5" + }, + { + "env": "BUILD=test REMOTESTORAGE_SERVER=mysteryshack REQUIREMENTS=devel BUILD_PRS=false", + "python": "3.5" + }, + { + "env": "BUILD=test REMOTESTORAGE_SERVER=mysteryshack REQUIREMENTS=release BUILD_PRS=false", + "python": "3.5" + }, + { + "env": "BUILD=test REMOTESTORAGE_SERVER=mysteryshack REQUIREMENTS=minimal BUILD_PRS=false", + "python": "3.5" + }, + { + "env": "BUILD=test DAV_SERVER=radicale REQUIREMENTS=devel BUILD_PRS=true", + "python": "3.5" + }, + { + "env": "BUILD=test DAV_SERVER=radicale REQUIREMENTS=release BUILD_PRS=true", + "python": "3.5" + }, + { + "env": "BUILD=test DAV_SERVER=radicale REQUIREMENTS=minimal BUILD_PRS=true", + "python": "3.5" + }, + { + "env": "BUILD=test DAV_SERVER=owncloud REQUIREMENTS=devel BUILD_PRS=false", + "python": "3.5" + }, + { + "env": "BUILD=test DAV_SERVER=owncloud REQUIREMENTS=release BUILD_PRS=false", + "python": "3.5" + }, + { + "env": "BUILD=test DAV_SERVER=owncloud REQUIREMENTS=minimal BUILD_PRS=false", + "python": "3.5" + }, + { + "env": "BUILD=test DAV_SERVER=baikal REQUIREMENTS=devel BUILD_PRS=false", + "python": "3.5" + }, + { + "env": "BUILD=test DAV_SERVER=baikal REQUIREMENTS=release BUILD_PRS=false", + "python": "3.5" + }, + { + "env": "BUILD=test DAV_SERVER=baikal REQUIREMENTS=minimal BUILD_PRS=false", + "python": "3.5" + }, + { + "env": "BUILD=test DAV_SERVER=davical REQUIREMENTS=devel BUILD_PRS=false", + "python": "3.5" + }, + { + "env": "BUILD=test DAV_SERVER=davical REQUIREMENTS=release BUILD_PRS=false", + "python": "3.5" + }, + { + "env": "BUILD=test DAV_SERVER=davical REQUIREMENTS=minimal BUILD_PRS=false", + "python": "3.5" + }, + { + "env": "BUILD=style BUILD_PRS=true", + "python": "pypy" + }, + { + "env": "BUILD=test DAV_SERVER=radicale REQUIREMENTS=devel BUILD_PRS=false", + "python": "pypy" + }, + { + "env": "BUILD=test DAV_SERVER=radicale REQUIREMENTS=release BUILD_PRS=false", + "python": "pypy" + }, + { + "env": "BUILD=test DAV_SERVER=radicale REQUIREMENTS=minimal BUILD_PRS=false", + "python": "pypy" + }, + { + "env": "BUILD=test", + "language": "generic", + "os": "osx" + } + ] + }, + "script": [ + "if [ \"$BUILD_PRS\" = \"true\" ] || [ \"$TRAVIS_PULL_REQUEST\" = \"false\" ]; then\n make -e $BUILD\nfi" + ], + "sudo": true +} \ No newline at end of file diff --git a/scripts/make_travisconf.py b/scripts/make_travisconf.py index a7aceac..107eb76 100644 --- a/scripts/make_travisconf.py +++ b/scripts/make_travisconf.py @@ -1,75 +1,81 @@ -import contextlib import itertools - -print("# Generated by scripts/make_travisconf.py") -print("") - -i = 0 +import json +import sys -def p(s): - print(" " * i + s) +def script(x): + return """ +if [ "$BUILD_PRS" = "true" ] || [ "$TRAVIS_PULL_REQUEST" = "false" ]; then + {} +fi + """.strip().format(x.strip()) +cfg = {} -@contextlib.contextmanager -def section(name): - p("{}:".format(name)) - global i - i += 1 - yield - i -= 1 - print("") +cfg['sudo'] = True +cfg['language'] = 'python' -p("sudo: true") -p("language: python") -p("") +cfg['branches'] = { + 'only': ['auto', 'master'] +} -with section("install"): - p('- ". scripts/travis-install.sh"') +cfg['install'] = [script(""" + . scripts/travis-install.sh; + pip install -U pip; + pip install wheel; + make -e install-dev; + make -e install-$BUILD; +""")] - p('- "pip install -U pip"') - p('- "pip install wheel"') - p('- "make -e install-dev"') - p('- "make -e install-$BUILD"') +cfg['script'] = [script(""" + make -e $BUILD +""")] -with section("script"): - p('- "make -e $BUILD"') +matrix = [] +cfg['matrix'] = {'include': matrix} -with section("matrix"): - with section("include"): - for python in ("2.7", "3.3", "3.4", "3.5", "pypy"): - h = lambda: p("- python: {}".format(python)) - h() - p(" env: BUILD=style") +for python in ("2.7", "3.3", "3.4", "3.5", "pypy"): + matrix.append({ + 'python': python, + 'env': 'BUILD=style BUILD_PRS=true' + }) - if python in ("2.7", "3.5"): - dav_servers = ("radicale", "owncloud", "baikal", "davical") - rs_servers = ("mysteryshack",) - else: - dav_servers = ("radicale",) - rs_servers = () + if python in ("2.7", "3.5"): + dav_servers = ("radicale", "owncloud", "baikal", "davical") + rs_servers = ("mysteryshack",) + else: + dav_servers = ("radicale",) + rs_servers = () - for (server_type, server), requirements in itertools.product( - itertools.chain( - (("REMOTESTORAGE", x) for x in rs_servers), - (("DAV", x) for x in dav_servers) - ), - ("devel", "release", "minimal") - ): - h() - p(" env: " - "BUILD=test " - "{server_type}_SERVER={server} " - "REQUIREMENTS={requirements}" - .format(server_type=server_type, - server=server, - requirements=requirements)) + for (server_type, server), requirements in itertools.product( + itertools.chain( + (("REMOTESTORAGE", x) for x in rs_servers), + (("DAV", x) for x in dav_servers) + ), + ("devel", "release", "minimal") + ): + build_prs = ( + python in ("2.7", "3.5") and + server_type == 'DAV' and + server == 'radicale' + ) - p("- language: generic") - p(" os: osx") - p(" env: BUILD=test") + matrix.append({ + 'python': python, + 'env': ("BUILD=test " + "{server_type}_SERVER={server} " + "REQUIREMENTS={requirements} " + "BUILD_PRS={build_prs}" + .format(server_type=server_type, + server=server, + requirements=requirements, + build_prs='true' if build_prs else 'false')) + }) -with section("branches"): - with section("only"): - p('- auto') - p('- master') +matrix.append({ + 'language': 'generic', + 'os': 'osx', + 'env': 'BUILD=test' +}) + +json.dump(cfg, sys.stdout, sort_keys=True, indent=2)