diff --git a/library/templates/tox.yaml b/library/templates/tox.yaml new file mode 100644 index 0000000..96f65b0 --- /dev/null +++ b/library/templates/tox.yaml @@ -0,0 +1,70 @@ +- job-template: + id: 'library/tox' + name: '{project-key}.{repo-slug}.{branch-display-name}.tox' + + description: | +
+ 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}' \ No newline at end of file diff --git a/reference/servers/example/tox.yaml b/reference/servers/example/tox.yaml new file mode 100644 index 0000000..f4e975f --- /dev/null +++ b/reference/servers/example/tox.yaml @@ -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 \ No newline at end of file