Skip to content

Commit

Permalink
Put back Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagobento committed Aug 31, 2021
1 parent 8fae3a6 commit e23131f
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .ci/Jenkins/Jenkinsfile.vscode
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env groovy

node('rhel8') {
stage('Install requirements') {
def nodeHome = tool 'nodejs-12.13.1'
env.PATH = "${env.PATH}:${nodeHome}/bin"
sh 'node -v'
sh 'npm -v'
}

stage('Download VSIX files') {
sh 'wget "https://github.com/kiegroup/kogito-tooling/releases/download/$VERSION/vscode_extension_bpmn_editor_$VERSION.vsix"'
sh 'wget "https://github.com/kiegroup/kogito-tooling/releases/download/$VERSION/vscode_extension_dmn_editor_$VERSION.vsix"'
sh 'wget "https://github.com/kiegroup/kogito-tooling/releases/download/$VERSION/vscode_extension_pmml_editor_$VERSION.vsix"'
sh 'wget "https://github.com/kiegroup/kogito-tooling/releases/download/$VERSION/vscode_extension_red_hat_business_automation_bundle_$VERSION.vsix"'
sh 'wget "https://github.com/kiegroup/kogito-tooling/releases/download/$VERSION/vscode_extension_kogito_bundle_$VERSION.vsix"'
sh 'md5sum *.vsix'
}

stage('Archive VSIX files') {
def vsix = findFiles(glob: '**.vsix')
archiveArtifacts artifacts: '**.vsix'
}

if (publishToMarketPlace.equals('true') || publishToOVSX.equals('true')) {
timeout(time:1, unit:'DAYS') {
input message:'Approve deployment?', submitter: 'eignatow,gcaponet,tfernand'
}

def vsix_editors = findFiles(glob: '**editor*.vsix')
def vsix_redhat_bundle = findFiles(glob: '**red_hat*.vsix')
def vsix_kogito_bundle = findFiles(glob: '**kogito*.vsix')

if (publishToMarketPlace.equals('true')) {
stage('Publish to VS Code Marketplace') {
sh 'npm install -g vsce'
withCredentials([[$class: 'StringBinding', credentialsId: 'vscode_java_marketplace', variable: 'TOKEN']]) {
sh 'vsce publish -p ${TOKEN} --packagePath' + " ${vsix_editors[0].path}"
sh 'vsce publish -p ${TOKEN} --packagePath' + " ${vsix_editors[1].path}"
sh 'vsce publish -p ${TOKEN} --packagePath' + " ${vsix_editors[2].path}"
sh 'vsce publish -p ${TOKEN} --packagePath' + " ${vsix_redhat_bundle[0].path}"
}
withCredentials([[$class: 'StringBinding', credentialsId: 'kie-vscode-token', variable: 'KIE_TOKEN']]) {
sh 'vsce publish -p ${KIE_TOKEN} --packagePath' + " ${vsix_kogito_bundle[0].path}"
}
}
}

if (publishToOVSX.equals('true')) {
stage('Publish to Open-vsx Marketplace') {
sh "npm install -g ovsx"
withCredentials([[$class: 'StringBinding', credentialsId: 'open-vsx-access-token', variable: 'OVSX_TOKEN']]) {
sh 'ovsx publish -p ${OVSX_TOKEN}' + " ${vsix_editors[0].path}"
sh 'ovsx publish -p ${OVSX_TOKEN}' + " ${vsix_editors[1].path}"
sh 'ovsx publish -p ${OVSX_TOKEN}' + " ${vsix_editors[2].path}"
sh 'ovsx publish -p ${OVSX_TOKEN}' + " ${vsix_redhat_bundle[0].path}"
}
withCredentials([[$class: 'StringBinding', credentialsId: 'kie-openvsx-token', variable: 'KIE_OVSX_TOKEN']]) {
sh 'ovsx publish -p ${KIE_OVSX_TOKEN}' + " ${vsix_kogito_bundle[0].path}"
}
}
}
}
}

0 comments on commit e23131f

Please sign in to comment.