3
3
node(' rhel8' ){
4
4
stage(' Checkout repos' ) {
5
5
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
- }
13
6
def hasServerDir = fileExists ' quarkus-ls'
14
7
if (! hasServerDir){
15
8
sh ' mkdir quarkus-ls'
@@ -22,7 +15,7 @@ node('rhel8'){
22
15
sh ' mkdir vscode-quarkus'
23
16
}
24
17
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"
26
19
}
27
20
}
28
21
@@ -54,10 +47,20 @@ node('rhel8'){
54
47
}
55
48
}
56
49
50
+ env. publishPreReleaseFlag = " "
51
+ if (' true' . equals(publishPreRelease)){
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
+
57
60
stage(' Package' ) {
58
61
dir (' vscode-quarkus' ) {
59
62
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"
61
64
sh " npm pack && mv vscode-quarkus-${ packageJson.version} .tgz ../vscode-quarkus-${ packageJson.version} -${ env.BUILD_NUMBER} .tgz"
62
65
}
63
66
}
@@ -73,32 +76,41 @@ node('rhel8'){
73
76
}
74
77
}
75
78
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
+ }
79
84
}
80
85
81
86
stage(" Publish to Marketplaces" ) {
82
87
unstash ' vsix'
83
88
unstash ' tgz'
84
89
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
+ }
88
96
}
89
97
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
+ }
94
104
}
95
105
96
106
archiveArtifacts artifacts :" **.vsix,**.tgz"
97
107
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
+ }
102
114
}
103
115
}
104
116
}
0 commit comments