Skip to content

Commit

Permalink
Adjust for live github
Browse files Browse the repository at this point in the history
  • Loading branch information
credman committed Jan 7, 2022
1 parent 898ec9a commit 2fb884e
Showing 1 changed file with 49 additions and 51 deletions.
100 changes: 49 additions & 51 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,67 +1,65 @@
pipeline {
agent any
environment {
//maintainer = "t"
//imagename = 'g'
//tag = 'l'
branch_name = 'GROUPER_2_6_BRANCH'
//branch_name = 'HEAD'
gpg_key = '1D3F3E9E30C7F312' //mch***@isc.upenn.edu
def repo = 'git@github.com:Internet2/grouper.git'
def gpg_key = '1D3F3E9E30C7F312'
def jdk_id = 'Corretto-JDK8'
def maven_id = 'Maven-3.8.4'

}
def tag_pattern = /^GROUPER_RELEASE_(\d+\.\d+\.\w+)$/

stages {

stage('DEBUG') {
steps {
sh "printenv"
}
}

stage('Checkout') {
steps {
checkout([
$class: 'GitSCM',
//branches: [[name: '*/$branch_name']],
branches: [[name: "*/${branch_name}"]],
doGenerateSubmoduleConfigurations: false,
//extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'different_directory']],
extensions: [
[$class: 'LocalBranch'], [$class: 'WipeWorkspace'],
[$class: 'CloneOption', depth: 1, noTags: true, reference: '', shallow: true],
],
submoduleCfg: [],
//userRemoteConfigs: [[url: 'git@github.com:Internet2/grouper.git']]
userRemoteConfigs: [[url: 'ssh://git@gitserver:22/git-server/repos/grouper.git', credentialsId: 'cer28-github']]
])
}
node('docker') {
if (params.branch_or_tag ==~ tag_pattern) {
stage("Checkout") {
checkout_result = checkout([
$class: 'GitSCM',
branches: [[name: params.branch_or_tag]],
extensions: [
[$class: 'LocalBranch'], [$class: 'WipeWorkspace'],
[$class: 'CloneOption', depth: 1, noTags: false, reference: '', shallow: true],
],
//userRemoteConfigs: [[url: 'git@github.com:Internet2/grouper.git']]
userRemoteConfigs: [[url: 'repo']]
]
)
println checkout_result
}

stage('Build') {
steps {
withMaven(
maven: 'Maven-3.8.4',
mavenSettingsFilePath: "travis/mvn.settings.xml",
mavenOpts: '-Xmx2048m',
jdk: 'Corretto JDK 8'
) {

def grouper_version = (params.branch_or_tag =~ tag_pattern)[0][1]

println "Extracted grouper version '${grouper_version}' from input '${params.branch_or_tag}'"

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

withMaven(
maven: maven_id,
mavenSettingsFilePath: "travis/mvn.settings.xml",
mavenOpts: '-Xmx2048m',
jdk: jdk_id
) {
sh "mvn -f grouper-misc/grouperClient clean compile"
}
}
}

stage('Release') {
steps {
withMaven(
maven: 'Maven-3.8.4',
mavenSettingsFilePath: "travis/mvn.settings.xml",
mavenOpts: '-Xmx2048m',
jdk: 'Corretto JDK 8'
) {
sh "mvn -f grouper-misc/grouperClient package gpg:sign -Dgpg.keyname=$gpg_key"
}
withMaven(
maven: maven_id,
mavenSettingsFilePath: "travis/mvn.settings.xml",
mavenOpts: '-Xmx2048m',
jdk: jdk_id
) {
sh "mvn -f grouper-misc/grouperClient package gpg:sign -Dgpg.keyname=${gpg_key}"
}
}
} else {
currentBuild.result = 'ABORTED'
error "Aborting build since tag doesn't match pattern '${tag_pattern}'"
}
}

0 comments on commit 2fb884e

Please sign in to comment.