forked from apache/incubator-kie-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8fae3a6
commit e23131f
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" | ||
} | ||
} | ||
} | ||
} | ||
} |