Skip to content

Instantly share code, notes, and snippets.

@cyrille-leclerc
Created March 10, 2018 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cyrille-leclerc/ae45e2017429cef071a3808b559f9675 to your computer and use it in GitHub Desktop.
Save cyrille-leclerc/ae45e2017429cef071a3808b559f9675 to your computer and use it in GitHub Desktop.
Jenkinsfile Release Maven Artifact and Submit Jira compliance Issue
node {
def pom
stage ("Release") {
deleteDir()
git 'https://github.com/cyrille-leclerc/my-jar.git'
withMaven(maven: "maven-3.5.2") {
sh "mvn release:prepare release:perform"
}
pom = readMavenPom file: 'target/checkout/pom.xml'
}
stage ("Compliance") {
def artifactId = pom.artifactId
def artifactVersion = pom.version
def complianceMap = input message: "Compliance Assessment for ${artifactId}:${artifactVersion}",
parameters: [
text(
name: 'StagedArtifacts',
description: '''For the artifacts included in the change request that are in staged repositories, provide the link so that they are released at the same of the CloudBees portfolio'''),
booleanParam(
name: 'OtherArtifacts',
description: '''Are any other artifacts included in the change request already publicly released?'''),
text(
name: 'AutomatedTesting',
description: '''Provide an assessment of the coverage of the contents of this change by automated tests. Links to the related tests are desirable.'''),
text(
name: 'ManualTesting',
description: '''If manual tests must be used to verify the change besides the automatic tests, provide the link to the test cases in TestRail.''')
],
submitterParameter: 'submitter'
def complianceIssue = [fields: [
project: [key: 'ATMZ'],
summary: "Update ${artifactId} to ${artifactVersion}",
description: "${complianceMap}",
issuetype: [name: 'Task'],
labels: ["change-request"]
]]
response = jiraNewIssue site: 'jira.beescloud.com', issue: complianceIssue
echo response.successful.toString()
echo response.data.toString()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment