Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1 from internet2/2.6.16
2.6.16
  • Loading branch information
mchyzer committed Sep 22, 2022
2 parents 6db14ce + 05e48d8 commit 1863981
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
/.project
11 changes: 11 additions & 0 deletions .project
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>grouper_build_v2_6</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
40 changes: 26 additions & 14 deletions Jenkinsfile
@@ -1,27 +1,37 @@
def repo = 'git@github.com:Internet2/grouper.git'
def gpg_key = '1D3F3E9E30C7F312'
def repo = 'https://github.com/Internet2/grouper.git'
def jdk_id = 'Corretto-JDK8'
def maven_id = 'Maven-3.8.4'
def java_home = '/home/centos/agent/tools/hudson.model.JDK/Corretto-JDK8/amazon-corretto-8.342.07.4-linux-x64'
def maven_id = 'maven'
def gpg_cred_id = 'grouper-gpg-key'
def sonatype_cred_id = 'grouper-sonatype-login'
def gpg_key = '30C7F312'

def git_tag = env.TAG_NAME ?: env.BRANCH_NAME
def tag_pattern = /^(\d+\.\d+\.\w+)$/
def grouper_src_branch = "GROUPER_RELEASE_${git_tag}"

node('docker') {

if (git_tag ==~ tag_pattern ) {
environment {
JAVA_HOME=java_home
}
stage("PgpImport") {
withCredentials([file(credentialsId: 'grouper-pgp', variable: 'GPG_KEYS')]) {
sh 'gpg --keyring=pubring.gpg --no-default-keyring --import $GPG_KEYS'
withCredentials([file(credentialsId: gpg_cred_id, variable: 'GPG_KEYS')]) {
sh 'gpg --version'
sh 'gpg --keyring=pubring.gpg --no-default-keyring --import $GPG_KEYS || true'
sh 'echo $JAVA_HOME'
sh 'java --version'
}
}

stage("Checkout") {
checkout_result = checkout([
$class: 'GitSCM',
branches: [[name: grouper_src_branch]],
extensions: [
[$class: 'LocalBranch'], [$class: 'WipeWorkspace'],
[$class: 'CloneOption', depth: 1, noTags: false, reference: '', shallow: true],
[$class: 'LocalBranch'],
[$class: 'WipeWorkspace'],
[$class: 'CloneOption', noTags: false, shallow: true],
],
userRemoteConfigs: [[url: repo]]
]
Expand All @@ -32,37 +42,39 @@ node('docker') {
def grouper_version = (git_tag =~ tag_pattern)[0][1]

println "Extracted grouper version '${grouper_version}' from input '${git_tag}'"

sh 'echo JAVA_HOME=$JAVA_HOME'
withMaven(
maven: maven_id,
mavenSettingsFilePath: "travis/mvn.settings.xml",
jdk: jdk_id
) {
sh "mvn -f grouper-parent versions:set -DnewVersion=${grouper_version}"
sh "JAVA_HOME=${java_home} mvn -f grouper-parent versions:set -DnewVersion=${grouper_version}"
}
}

stage('Build') {
sh 'echo JAVA_HOME=$JAVA_HOME'
withMaven(
maven: maven_id,
mavenSettingsFilePath: "travis/mvn.settings.xml",
mavenOpts: '-Xmx2048m',
jdk: jdk_id
) {
sh "mvn -f grouper-parent clean compile package"
sh "JAVA_HOME=${java_home} mvn -f grouper-parent clean compile package"
}
}

stage('Release') {
withCredentials([usernamePassword(credentialsId: 'grouper-sonatype-login', usernameVariable: 'SONATYPE_USER', passwordVariable: 'SONATYPE_PWD')]) {
withCredentials([usernamePassword(credentialsId: sonatype_cred_id, usernameVariable: 'SONATYPE_USER', passwordVariable: 'SONATYPE_PWD')]) {
sh 'echo JAVA_HOME=$JAVA_HOME'
withMaven(
maven: maven_id,
mavenSettingsFilePath: "travis/mvn.settings.xml",
mavenOpts: '-Xmx2048m',
jdk: jdk_id
) {
sh "mvn -f grouper-parent deploy -Prelease -Dgpg.keyname=$GPG_KEY"
}
sh "JAVA_HOME=${java_home} mvn -f grouper-parent deploy -Prelease -Dgpg.keyname='${gpg_key}'"
}
}
}
} else {
Expand Down
1 change: 1 addition & 0 deletions temp.txt
@@ -0,0 +1 @@
2.6.16 release

0 comments on commit 1863981

Please sign in to comment.