Skip to content

Commit

Permalink
Merge branch 'release-test' into releases/2.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
slu-it committed Mar 9, 2017
2 parents 5856087 + b01b170 commit c85f38f
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 18 deletions.
55 changes: 37 additions & 18 deletions build-release.jenkins
Original file line number Diff line number Diff line change
@@ -1,26 +1,45 @@
node {
stage('Prepare Environment') {
def mvnHome = tool 'Maven 3.3.9'
def javaHome = tool 'Oracle JDK 8'
env.JAVA_HOME="${javaHome}"
env.MAVEN_HOME="${mvnHome}"
env.PATH="${env.JAVA_HOME}/bin:${env.MAVEN_HOME}/bin:${env.PATH}"
}
// must be executed on a docker-enabled node
node('docker-based-builds') {

// check out branch that triggered the build
stage('Checkout SCM') {
checkout scm
}
stage('Set Version to $VERSION') {
dir('webtester-build-tools') {

// load build environment docker container
def container = docker.image('caaqe/webtester2-build-environment:latest')
container.pull()
container.inside {

stage('Log Tool Versions') {
sh 'java -version'
sh 'git --version'
sh 'mvn --version'
sh 'gpg --version'
}

stage('Set Version to $VERSION') {
sh 'cd webtester-build-tools && mvn versions:set versions:commit -DnewVersion=$VERSION'
sh 'mvn versions:set versions:commit -DnewVersion=$VERSION'
}
sh 'mvn versions:set versions:commit -DnewVersion=$VERSION'
}
stage('Build & Deploy to Sonatype OSS') {
withCredentials([string(credentialsId: 'webtester-gpg-passphrase', variable: 'GPG_PASSPHRASE')]) {
def skipTests = "-DskipUnitTests=true -DskipIntegrationTests=true"
def gpgPassphrase = "-Dgpg.passphrase=$GPG_PASSPHRASE"
def profiles = "-P documentation,release,maven-central"
sh "mvn clean deploy ${skipTests} ${gpgPassphrase} ${profiles}"

stage('Build & Deploy to Sonatype OSS') {
// credentials for the repository are stored in Jenkins
withCredentials([usernamePassword(credentialsId: 'ossrh-credentials', passwordVariable: 'ossrhPassword', usernameVariable: 'ossrhUsername')]) {
// credentials for the GPG certificates are stored in Jenkins
withCredentials([string(credentialsId: 'webtester-gpg-passphrase', variable: 'gpgPassphrase')]) {

def skipTests = "-DskipUnitTests=true -DskipIntegrationTests=true"
def gpgPassphrase = "-Dgpg.passphrase=${gpgPassphrase}"
def repositoryCredentials = "-Dossrh.username=${ossrhUsername} -Dossrh.password=${ossrhPassword}"
def profiles = "-P documentation,release,maven-central"

sh "mvn clean deploy ${skipTests} ${gpgPassphrase} ${repositoryCredentials} ${profiles}"

}
}
}

}

}
1 change: 1 addition & 0 deletions build-snapshot.jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ node('docker-based-builds') {
}

}

}
5 changes: 5 additions & 0 deletions webtester-build-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<gpg.keyname>WebTester</gpg.keyname>
<version.maven.javadoc.plugin>2.10.3</version.maven.javadoc.plugin>
<version.maven.source.plugin>3.0.0</version.maven.source.plugin>
<version.maven.gpg.plugin>1.6</version.maven.gpg.plugin>
Expand Down Expand Up @@ -78,6 +79,10 @@
<goals>
<goal>sign</goal>
</goals>
<configuration>
<keyname>${gpg.keyname}</keyname>
<passphrase>${gpg.passphrase}</passphrase>
</configuration>
</execution>
</executions>
</plugin>
Expand Down

0 comments on commit c85f38f

Please sign in to comment.