-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
141 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
--- | ||
- job-template: | ||
name: "tendrl-pr-trigger-tests-{package_name}" | ||
display-name: 'Tendrl trigger tests (PR) - {package_name}' | ||
description: | | ||
<b>Job triggering test suite execution.</b><br> | ||
<br> | ||
It might be triggered by following phrase in comment in the respective PR: | ||
<pre> | ||
run tests | ||
</pre> | ||
And it is also possible to specify dependencies on PRs from other repos | ||
in following format (in the PR description or in the comment triggering | ||
the tests) | ||
<pre> | ||
Depends on: <repo-name>/pr<pr_id> <repo2-name>/pr<pr2_id> | ||
</pre> | ||
where <i><repo-name></i> is repo name including <i>tendrl-</i> prefix | ||
and <pr_id> is PR number. | ||
<br><br> | ||
Maintainer: <a href="mailto:[email protected]">Daniel Horak</a><br> | ||
Team Contact: <a href="mailto:[email protected]">tendrl-devel</a><br> | ||
JJB Code Location: <a href="https://github.com/Tendrl/tendrl-ci/tree/master/jobs">tendrl-ci</a><br> | ||
Managed by Jenkins Job Builder. Do not edit via web.<br> | ||
project-type: freestyle | ||
package_prefix: "tendrl-" | ||
defaults: global | ||
disabled: false | ||
concurrent: false | ||
quiet-period: 0 | ||
block-downstream: false | ||
block-upstream: false | ||
node: 'tendrl-ci-slave01' | ||
triggers: "{obj:triggers}" | ||
scm: "{obj:scm}" | ||
properties: | ||
- github: | ||
url: 'https://github.com/Tendrl/{package_name}/' | ||
wrappers: | ||
- timeout: | ||
timeout: 60 | ||
abort: true | ||
type: absolute | ||
parameters: | ||
- string: | ||
name: ADDITIONAL_REPOS | ||
default: "" | ||
description: "Coma separated list of additional repos." | ||
- string: | ||
name: ADDITIONAL_REPOS_USM_SERVER | ||
default: "" | ||
description: "Coma separated list of additional repos." | ||
- string: | ||
name: ADDITIONAL_REPOS_USM_NODES | ||
default: "" | ||
description: "Coma separated list of additional repos." | ||
- string: | ||
name: ADDITIONAL_REPOS_USM_CLIENT | ||
default: "" | ||
description: "Coma separated list of additional repos." | ||
builders: | ||
- shell: | | ||
#!/bin/bash -xe | ||
echo | ||
if [[ "${{ghprbPullId}}" ]]; then | ||
echo "ghprbPullId: ${{ghprbPullId}}" | ||
echo "ghprbCommentBody: ${{ghprbCommentBody}}" | ||
echo "ghprbPullLongDescription: ${{ghprbPullLongDescription}}" | ||
ADDITIONAL_REPOS="${{ADDITIONAL_REPOS}},http://artifacts.ci.centos.org/tendrl/pr/{package_prefix}{package_name}/pr${{ghprbPullId}}/{package_prefix}{package_name}-pr${{ghprbPullId}}.repo" | ||
echo | ||
echo "Parse ghprbCommentBody and ghprbPullLongDescription for dependent PRs." | ||
# filter only lines containing "depends on:" string (and remove it) | ||
# so it will iterate over list similar to this: | ||
# tendrl-notifier/pr153 tendrl-commons/pr820 ... | ||
for dependency in $(echo -e "${{ghprbCommentBody}}\n${{ghprbPullLongDescription}}" | \ | ||
grep -i "depends on:" | sed 's/depends on: //I'); do | ||
package=${{dependency%/*}} | ||
pr_id=${{dependency#*/}} | ||
ADDITIONAL_REPOS="${{ADDITIONAL_REPOS}},http://artifacts.ci.centos.org/tendrl/pr/${{package}}/${{pr_id}}/${{package}}-${{pr_id}}.repo" | ||
done | ||
echo | ||
fi | ||
echo "Run whole test suite." | ||
echo "##############################################################" | ||
echo | ||
# Prepare env.sh file | ||
echo > ${{WORKSPACE}}/env.sh | ||
echo "ADDITIONAL_REPOS=${{ADDITIONAL_REPOS}}" >> ${{WORKSPACE}}/env.sh | ||
echo "ADDITIONAL_REPOS_USM_SERVER=${{ADDITIONAL_REPOS_USM_SERVER}}" >> ${{WORKSPACE}}/env.sh | ||
echo "ADDITIONAL_REPOS_USM_NODES=${{ADDITIONAL_REPOS_USM_NODES}}" >> ${{WORKSPACE}}/env.sh | ||
echo "ADDITIONAL_REPOS_USM_CLIENT=${{ADDITIONAL_REPOS_USM_CLIENT}}" >> ${{WORKSPACE}}/env.sh | ||
- trigger-builds: | ||
- project: "tendrl-2-cluster-gluster" | ||
property-file: env.sh | ||
block: true | ||
|
||
publishers: | ||
- email: | ||
recipients: [email protected] | ||
|
||
|
||
- project: | ||
name: 'Test_suite' | ||
triggers: | ||
- github-pull-request: | ||
admin-list: | ||
- dahorak | ||
org-list: | ||
- Tendrl | ||
allow-whitelist-orgs-as-admins: true | ||
trigger-phrase: '.*run test.*' | ||
only-trigger-phrase: true | ||
skip-build-phrase: 'no test' | ||
github-hooks: true | ||
cancel-builds-on-update: true | ||
status-context: 'CentOS CI - tests' | ||
status-add-test-results: false | ||
scm: | ||
- git: | ||
url: 'https://github.com/Tendrl/{package_name}' | ||
refspec: "+refs/pull/${{ghprbPullId}}/*:refs/remotes/origin/pr/${{ghprbPullId}}/*" | ||
basedir: tendrl-{package_name} | ||
skip-tag: true | ||
wipe-workspace: true | ||
jobs: | ||
- "tendrl-pr-trigger-tests-{package_name}" | ||
package_name: | ||
- api | ||
- commons | ||
- gluster-integration | ||
- monitoring-integration | ||
- node-agent | ||
- notifier | ||
- tendrl-ansible: | ||
package_prefix: "" | ||
- tendrl-selinux: | ||
package_prefix: "" | ||
- ui |