Skip to content
This repository was archived by the owner on Mar 11, 2022. It is now read-only.

Commit 9f9af9b

Browse files
authored
Merge pull request #563 from cloudant/global-gtap
Updated to global gitTagAndPublish
2 parents c73f0fb + 5273645 commit 9f9af9b

File tree

1 file changed

+3
-32
lines changed

1 file changed

+3
-32
lines changed

Jenkinsfile

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ stage('QA') {
121121
stage('Publish') {
122122
if (env.BRANCH_NAME == "master") {
123123
node {
124-
checkout scm // re-checkout to be able to git tag
125124
unstash name: 'built'
126125
// read the version name and determine if it is a release build
127126
version = readFile('VERSION').trim()
@@ -132,37 +131,9 @@ stage('Publish') {
132131
sh './gradlew -Dsigning.keyId=$KEY_ID -Dsigning.password=$KEY_PASSWORD -Dsigning.secretKeyRingFile=$SIGNING_FILE -DossrhUsername=$OSSRH_USER -DossrhPassword=$OSSRH_PASSWORD upload'
133132
}
134133

135-
// if it is a release build then do the git tagging
136-
if (isReleaseVersion) {
137-
138-
// Read the CHANGES.md to get the tag message
139-
changes = """"""
140-
changes += readFile('CHANGES.md')
141-
tagMessage = """"""
142-
for (line in changes.readLines()) {
143-
if (!"".equals(line)) {
144-
// append the line to the tagMessage
145-
tagMessage = "${tagMessage}${line}\n"
146-
} else {
147-
break
148-
}
149-
}
150-
151-
// Use git to tag the release at the version
152-
try {
153-
// Awkward workaround until resolution of https://issues.jenkins-ci.org/browse/JENKINS-28335
154-
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'github-token', usernameVariable: 'GIT_USERNAME', passwordVariable: 'GIT_PASSWORD']]) {
155-
sh "git config user.email \"[email protected]\""
156-
sh "git config user.name \"Jenkins CI\""
157-
sh "git config credential.username ${env.GIT_USERNAME}"
158-
sh "git config credential.helper '!echo password=\$GIT_PASSWORD; echo'"
159-
sh "git tag -a ${version} -m '${tagMessage}'"
160-
sh "git push origin ${version}"
161-
}
162-
} finally {
163-
sh "git config --unset credential.username"
164-
sh "git config --unset credential.helper"
165-
}
134+
gitTagAndPublish {
135+
isDraft=true
136+
releaseApiUrl='https://api.github.com/repos/cloudant/sync-android/releases'
166137
}
167138
}
168139
}

0 commit comments

Comments
 (0)