Skip to content

Commit

Permalink
Add tox templates
Browse files Browse the repository at this point in the history
This patch adds tox templates for running tox on
generic repository
  • Loading branch information
akaRem committed May 4, 2017
1 parent 3cbcd2b commit ae3ac19
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
70 changes: 70 additions & 0 deletions library/templates/tox.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
- job-template:
id: 'library/tox'
name: '{project-key}.{repo-slug}.{branch-display-name}.tox'

description: |
<h2> Tox tests
<p>
Run tox for PRs in {project-key}/{repo-slug} proposed to {branch}
node: '{tox/node}'

concurrent: true

stash-poll-timer: '* * * * *' # !default
tox/timeout: 10 # !default

parameters:
- library/stash-trigger/parameters

wrappers:
- inject-passwords:
global: true
mask-password-params: true
- ansicolor:
colormap: xterm
- timeout:
fail: true
timeout: '{tox/timeout}'
write-description: true

triggers:
- library/stash-trigger/trigger:
project-key: '{project-key}'
repo-slug: '{repo-slug}'
branch: '{branch}'
timer: '{stash-poll-timer}'
host: '{host}'
credentials-id: '{credentials-id}'
username: '{username}'
password: '{password}'

scm:
- library/stash-trigger/scm:
host: '{host}'
port: '{port}'
username: '{username}'
password: '{password}'
credentials-id: '{credentials-id}'

builders:
- shell: |
#!/bin/bash
set -ex
# workaround for old RHELs, we need to install correct tox system-wide
rm -rf venv
virtualenv venv
source venv/bin/activate
pip install pip --upgrade
pip install tox
# ---
rm -rf .tox
tox
publishers:
- library/stash-trigger/publish-feedback:
username: '{username}'
password: '{password}'
credentials-id: '{credentials-id}'
20 changes: 20 additions & 0 deletions reference/servers/example/tox.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
- project:
name: tox-example

tox/node: tox-node # example

project-key: AA # example
repo-slug: jjb-library # example
branch-display-name: master
branch: master

host: git.my-bitbucket.org
port: 443
credentials-id: ''
username: ''
password: ''

tox/timeout: 10

jobs:
- library/tox

0 comments on commit ae3ac19

Please sign in to comment.