Skip to content

Commit

Permalink
Merge pull request #536 from szprutamich/master
Browse files Browse the repository at this point in the history
Fix Jenkinsfile deployment
  • Loading branch information
szprutamich authored Aug 28, 2024
2 parents 95286db + da7b941 commit e6cf3f9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
34 changes: 27 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,35 @@ node('linux && maven && gpg') {
]
])
}
stage('Deploy') {
wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {
script {
def version = sh(returnStdout: true, script: 'mvn help:evaluate -Dexpression=project.version -q -DforceStdout')
def gh = new Github(this, 'testdroid-api', 'bitbar')
gh.release('master', 'v' + version, "Version ${version}")
sh('mvn clean package source:jar javadoc:jar gpg:sign nexus-staging:deploy')
try {
stage('Export gpg keys') {
withCredentials([string(credentialsId: 'gpg_passphrase', variable: 'GPG_PASSPHRASE')]) {
sh('mkdir -p /tmp/gpg')
sh('gpg --batch --pinentry-mode=loopback --yes --passphrase ${GPG_PASSPHRASE} --export-secret-key -a "Info Bitbar" > /tmp/gpg/prv.key')
sh('gpg --export -a "Info Bitbar" > /tmp/gpg/pub.key')
}
}
docker.image("maven:3.9.8-eclipse-temurin-17").inside("-u 0:0 -v /home/testdroid/.m2:/root/.m2 -v /tmp/gpg:/gpg") {

stage('Deploy') {
wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {
script {
sh('apt update && apt install -y gnupg')
sh('gpg --list-keys')
sh('gpg --batch --import /gpg/prv.key')
sh('gpg --batch --import /gpg/pub.key')
sh('sleep 5')
sh('gpg --list-keys')
def version = sh(returnStdout: true, script: 'mvn help:evaluate -Dexpression=project.version -q -DforceStdout')
def gh = new Github(this, 'testdroid-api', 'bitbar')
gh.release('master', 'v' + version, "Version ${version}")
sh('mvn clean package source:jar javadoc:jar gpg:sign nexus-staging:deploy')
}
}
}
}
} finally {
sh('rm -rf /tmp/gpg/')
}
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.testdroid</groupId>
<artifactId>testdroid-api</artifactId>
<version>3.33.0</version>
<version>3.33.1</version>
<packaging>jar</packaging>
<name>Bitbar API v2</name>
<url>https://github.com/bitbar/testdroid-api</url>
Expand Down

0 comments on commit e6cf3f9

Please sign in to comment.