Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,48 @@ node('rhel7'){
def recipientList = 'jbosstools-builds@lists.jboss.org'
def javaHome = tool 'openjdk-11'
env.JAVA_HOME = "${javaHome}"

try {
stage('Checkout repo') {
deleteDir()
git url: 'https://github.com/redhat-developer/intellij-dependency-analytics',
branch: "${sha1}"
}

def props = readProperties file: 'gradle.properties'
def isSnapshot = props['projectVersion'].contains('-SNAPSHOT')
def version = isSnapshot?props['projectVersion'].replace('-SNAPSHOT', ".${env.BUILD_NUMBER}"):props['projectVersion'] + ".${env.BUILD_NUMBER}"

stage('Build') {
sh "./gradlew assemble -PprojectVersion=${version}"
}

stage('Package') {
sh "./gradlew buildPlugin -PprojectVersion=${version}"
}

if(params.UPLOAD_LOCATION) {
stage('Upload') {
def filesToPush = findFiles(glob: '**/*.zip')
sh "sftp -C ${UPLOAD_LOCATION}/snapshots/intellij-dependency-analytics/ <<< \$'put -p \"${filesToPush[0].path}\"'"
stash name:'zip', includes:filesToPush[0].path
}
}

if(publishToMarketPlace.equals('true')){
timeout(time:5, unit:'DAYS') {
input message:'Approve deployment?', submitter: 'jmaury'
input message:'Approve deployment?', submitter: 'jmaury, tfigenbl'
}

def channel = isSnapshot?"nightly":"stable"

stage("Publish to Marketplace") {
unstash 'zip'
withCredentials([[$class: 'StringBinding', credentialsId: 'JetBrains marketplace token', variable: 'TOKEN']]) {
sh "./gradlew publishPlugin -PjetBrainsToken=${TOKEN} -PprojectVersion=${version} -PjetBrainsChannel=${channel}"
}
archive includes:"**.zip"

if (!isSnapshot) {
stage("Promote the build to stable") {
def zip = findFiles(glob: '**/*.zip')
Expand Down