forked from open-webrtc-toolkit/owt-client-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add jenkinsfile for p2ptest on k8s (open-webrtc-toolkit#502)
- Loading branch information
Showing
1 changed file
with
50 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,50 @@ | ||
void setBuildStatus(String jsUrl, String message, String state) { | ||
step([ | ||
$class: "GitHubCommitStatusSetter", | ||
reposSource: [$class: "ManuallyEnteredRepositorySource", url: jsUrl], | ||
contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/p2p"], | ||
errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]], | ||
statusResultSource: [ $class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]] ] | ||
]); | ||
} | ||
|
||
pipeline { | ||
agent any | ||
options { | ||
disableConcurrentBuilds() | ||
buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10')) | ||
} | ||
stages { | ||
stage('runJsCI') { | ||
options { timeout(time: 30, unit: 'MINUTES') } | ||
steps { | ||
podTemplate(name: 'p2ptest-ubuntu-'+env.GIT_BRANCH, label: 'p2ptest-ubuntu-'+env.GIT_BRANCH, | ||
containers: [ | ||
containerTemplate(name: 'p2ptest-images', image: "$env.ubuntu_p2p_images", ttyEnabled: true, privileged: true, resourceRequestCpu: '5000m', resourceLimitCpu: '6000m' , command: 'cat') | ||
]){ | ||
node('p2ptest-ubuntu-'+env.GIT_BRANCH) { | ||
checkout scm | ||
container('p2ptest-images') { | ||
sh "python ${env.startServerScript} --p2p-server-path ${env.p2pServerPath} \ | ||
--owner open-webrtc-toolkit --repo owt-client-javascript --commit-id ${GIT_COMMIT} \ | ||
--git-branch ${GIT_BRANCH} --github-script ${env.GithubScriptPath} --mode p2p --workspace ${WORKSPACE}" | ||
sh "python ${env.jsCiScriptPath}/runTest.py --mode ci --source-path ${WORKSPACE} \ | ||
--browsers chrome --mode ci --owner open-webrtc-toolkit --repo owt-client-javascript \ | ||
--git-branch ${GIT_BRANCH} --github-script ${env.GithubScriptPath}" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
post { | ||
success { | ||
setBuildStatus("${env.jsUrl}", "Build succeeded", "SUCCESS"); | ||
} | ||
failure { | ||
setBuildStatus("${env.jsUrl}", "Build failed", "FAILURE"); | ||
} | ||
} | ||
} | ||
|