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 6, 2017
1 parent d9d7e58 commit c7dbd3b
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 0 deletions.
6 changes: 6 additions & 0 deletions library/scripts/jjb_compare_xml.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/bash

# This script expects these environment variables to be set:
# WORKSPACE - std. Jenkins variable, workspace of current build
# BUILD_URL - std. Jenkins variable, url of current build
# targetBranch - target branch of pull-request, provided by stash-pr-trigger
# pullRequestId - pull-request ID, provided by stash-pr-trigger

set -ex

# workaround for old RHELs, we need to install correct tox system-wide
Expand Down
71 changes: 71 additions & 0 deletions library/templates/tox.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
- 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:
host: '{host}'
username: '{username}'
password: '{password}'
credentials-id: '{credentials-id}'
20 changes: 20 additions & 0 deletions servers/example/projects/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 c7dbd3b

Please sign in to comment.