33node(' rhel8' ){
44 stage(' Checkout repos' ) {
55 deleteDir()
6- def hasLsp4mpDir = fileExists ' lsp4mp'
7- if (! hasLsp4mpDir){
8- sh ' mkdir lsp4mp'
9- }
10- dir (' lsp4mp' ) {
11- git url : ' https://github.com/eclipse/lsp4mp.git'
12- }
136 def hasServerDir = fileExists ' quarkus-ls'
147 if (! hasServerDir){
158 sh ' mkdir quarkus-ls'
@@ -22,7 +15,7 @@ node('rhel8'){
2215 sh ' mkdir vscode-quarkus'
2316 }
2417 dir (' vscode-quarkus' ) {
25- git url : ' https://github.com/redhat-developer /vscode-quarkus.git'
18+ git url : " https://github.com/${ params.FORK } /vscode-quarkus.git"
2619 }
2720 }
2821
@@ -54,10 +47,20 @@ node('rhel8'){
5447 }
5548 }
5649
50+ env. publishPreReleaseFlag = " "
51+ if (publishPreRelease. equals(' true' )){
52+ stage(" Prepare for pre-release" ) {
53+ dir (' vscode-quarkus' ) {
54+ sh " npx gulp prepare_pre_release"
55+ env. publishPreReleaseFlag = " --pre-release"
56+ }
57+ }
58+ }
59+
5760 stage(' Package' ) {
5861 dir (' vscode-quarkus' ) {
5962 def packageJson = readJSON file : ' package.json'
60- sh " vsce package -o ../vscode-quarkus-${ packageJson.version} -${ env.BUILD_NUMBER} .vsix"
63+ sh " vsce package ${ env.publishPreReleaseFlag } -o ../vscode-quarkus-${ packageJson.version} -${ env.BUILD_NUMBER} .vsix"
6164 sh " npm pack && mv vscode-quarkus-${ packageJson.version} .tgz ../vscode-quarkus-${ packageJson.version} -${ env.BUILD_NUMBER} .tgz"
6265 }
6366 }
@@ -73,32 +76,41 @@ node('rhel8'){
7376 }
7477 }
7578
76- if (' true' . equals(publishToMarketPlace)){
77- timeout(time :5 , unit :' DAYS' ) {
78- input message :' Approve deployment?' , submitter : ' fbricon,rgrunber,azerr,davthomp'
79+ if (' true' . equals(publishToMarketPlace) || ' true' . equals(publishToOVSX) || ' true' . equals(publishPreRelease)){
80+ if (' true' . equals(publishToMarketPlace) || ' true' . equals(publishToOVSX)){
81+ timeout(time :5 , unit :' DAYS' ) {
82+ input message :' Approve deployment?' , submitter : ' fbricon,rgrunber,azerr,davthomp'
83+ }
7984 }
8085
8186 stage(" Publish to Marketplaces" ) {
8287 unstash ' vsix'
8388 unstash ' tgz'
8489 def vsix = findFiles(glob : ' **.vsix' )
85- // VS Code Marketplace
86- withCredentials([[$class : ' StringBinding' , credentialsId : ' vscode_java_marketplace' , variable : ' TOKEN' ]]) {
87- sh ' vsce publish -p ${TOKEN} --packagePath' + " ${ vsix[0].path} "
90+
91+ if (' true' . equals(publishToMarketPlace) || ' true' . equals(publishPreRelease)) {
92+ // VS Code Marketplace
93+ withCredentials([[$class : ' StringBinding' , credentialsId : ' vscode_java_marketplace' , variable : ' TOKEN' ]]) {
94+ sh ' vsce publish -p ${TOKEN} --packagePath' + " ${ vsix[0].path} "
95+ }
8896 }
8997
90- // open-vsx Marketplace
91- sh ' npm install -g ovsx'
92- withCredentials([[$class : ' StringBinding' , credentialsId : ' open-vsx-access-token' , variable : ' OVSX_TOKEN' ]]) {
93- sh ' ovsx publish -p ${OVSX_TOKEN}' + " ${ vsix[0].path} "
98+ if (' true' . equals(publishToOVSX)) {
99+ // open-vsx Marketplace
100+ sh ' npm install -g ovsx'
101+ withCredentials([[$class : ' StringBinding' , credentialsId : ' open-vsx-access-token' , variable : ' OVSX_TOKEN' ]]) {
102+ sh ' ovsx publish -p ${OVSX_TOKEN}' + " ${ vsix[0].path} "
103+ }
94104 }
95105
96106 archiveArtifacts artifacts :" **.vsix,**.tgz"
97107
98- stage " Promote the build to stable"
99- sh " sftp -C ${ UPLOAD_LOCATION} /stable/vscode-quarkus/ <<< \$ 'put -p ${ vsix[0].path} '"
100- def tgz = findFiles(glob : ' **.tgz' )
101- sh " sftp -C ${ UPLOAD_LOCATION} /stable/vscode-quarkus/ <<< \$ 'put -p ${ tgz[0].path} '"
108+ if (' true' . equals(publishToMarketPlace)) {
109+ stage " Promote the build to stable"
110+ sh " sftp -C ${ UPLOAD_LOCATION} /stable/vscode-quarkus/ <<< \$ 'put -p ${ vsix[0].path} '"
111+ def tgz = findFiles(glob : ' **.tgz' )
112+ sh " sftp -C ${ UPLOAD_LOCATION} /stable/vscode-quarkus/ <<< \$ 'put -p ${ tgz[0].path} '"
113+ }
102114 }
103115 }
104116}
0 commit comments