This repository has been archived by the owner on Feb 22, 2024. It is now read-only.
-
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.
Browse files
Browse the repository at this point in the history
Feature/#1 configuration
- Loading branch information
Showing
3 changed files
with
77 additions
and
3 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,53 @@ | ||
#!/usr/bin/env groovy | ||
@Library('jenkins-library@master') _ | ||
|
||
pipeline { | ||
agent { | ||
node { | ||
label 'docker' | ||
} | ||
} | ||
|
||
options { | ||
disableConcurrentBuilds() | ||
buildDiscarder(logRotator(numToKeepStr: '5', daysToKeepStr: '5')) | ||
} | ||
|
||
parameters { | ||
choice( | ||
name: "testTarget", | ||
choices: "latest\ntesting", | ||
description: "Set the DukeCon target environment for testing" | ||
) | ||
} | ||
|
||
triggers { | ||
pollSCM('*/3 * * * *') | ||
} | ||
|
||
stages { | ||
stage('API Test') { | ||
steps { | ||
sh "mvn ${mvnProfile(params.testTarget)} clean test" | ||
} | ||
} | ||
} | ||
post { | ||
always { | ||
sendNotification currentBuild.result | ||
} | ||
failure { | ||
// notify users when the Pipeline fails | ||
mail to: '[email protected]', | ||
subject: "Failed DukeCon API Test Pipeline: ${currentBuild.fullDisplayName}", | ||
body: "Something is wrong with ${env.BUILD_URL}" | ||
} | ||
} | ||
} | ||
|
||
def mvnProfile(testTarget) { | ||
if ("latest" != testTarget) { | ||
return "-P ${testTarget}" | ||
} | ||
return "" | ||
} |
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
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