Skip to content

Commit f723e28

Browse files
authored
Publish to different locations independent of each other (#1969)
1 parent bbcdede commit f723e28

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

Jenkinsfile

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,28 +48,33 @@ node('rhel8'){
4848
}
4949
}
5050

51-
if(publishToMarketPlace.equals('true')){
51+
if(publishToMarketPlace.equals('true') || publishToOVSX.equals('true')) {
5252
timeout(time:5, unit:'DAYS') {
5353
input message:'Approve deployment?', submitter: 'msuman,degolovi'
5454
}
5555

56-
stage("Publish to Marketplace") {
57-
withCredentials([[$class: 'StringBinding', credentialsId: 'vscode_java_marketplace', variable: 'TOKEN']]) {
58-
def vsix = findFiles(glob: '**.vsix')
59-
sh 'vsce publish -p ${TOKEN} --packagePath' + " ${vsix[0].path}"
60-
}
56+
if(publishToMarketPlace.equals('true')) {
57+
stage("Publish to Marketplace") {
58+
withCredentials([[$class: 'StringBinding', credentialsId: 'vscode_java_marketplace', variable: 'TOKEN']]) {
59+
def vsix = findFiles(glob: '**.vsix')
60+
sh 'vsce publish -p ${TOKEN} --packagePath' + " ${vsix[0].path}"
61+
}
6162

62-
// Open-vsx Marketplace
63-
sh "npm install -g ovsx"
64-
withCredentials([[$class: 'StringBinding', credentialsId: 'open-vsx-access-token', variable: 'OVSX_TOKEN']]) {
65-
def vsix = findFiles(glob: '**.vsix')
66-
sh 'ovsx publish -p ${OVSX_TOKEN}' + " ${vsix[0].path}"
63+
stage "Promote the build to stable"
64+
sh "rsync -Pzrlt --rsh=ssh --protocol=28 *.vsix* ${UPLOAD_LOCATION}/stable/vscode-openshift-tools/"
65+
sh "rsync -Pzrlt --rsh=ssh --protocol=28 *.tgz* ${UPLOAD_LOCATION}/stable/vscode-openshift-tools/"
66+
archive includes:"**.vsix*,**.tgz*"
6767
}
68+
}
6869

69-
stage "Promote the build to stable"
70-
sh "rsync -Pzrlt --rsh=ssh --protocol=28 *.vsix* ${UPLOAD_LOCATION}/stable/vscode-openshift-tools/"
71-
sh "rsync -Pzrlt --rsh=ssh --protocol=28 *.tgz* ${UPLOAD_LOCATION}/stable/vscode-openshift-tools/"
72-
archive includes:"**.vsix*,**.tgz*"
70+
if (publishToOVSX.equals('true')) {
71+
stage("Publish to OVSX") {
72+
sh "npm install -g ovsx"
73+
withCredentials([[$class: 'StringBinding', credentialsId: 'open-vsx-access-token', variable: 'OVSX_TOKEN']]) {
74+
def vsix = findFiles(glob: '**.vsix')
75+
sh 'ovsx publish -p ${OVSX_TOKEN}' + " ${vsix[0].path}"
76+
}
77+
}
7378
}
7479
}
7580
}

0 commit comments

Comments
 (0)