forked from eclipse/lsp4jakarta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Release.Jenkinsfile
117 lines (113 loc) · 4.53 KB
/
Release.Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
pipeline {
agent any
tools {
jdk 'temurin-jdk17-latest'
}
environment {
MAVEN_HOME = "$WORKSPACE/.m2/"
MAVEN_USER_HOME = "$MAVEN_HOME"
}
parameters {
string(name: 'VERSION', defaultValue: '', description: 'Version to Release?')
string(name: 'VERSION_SNAPSHOT', defaultValue: '', description: 'Next Development Version?')
}
stages {
stage("Release LSP4Jakarta Language Server"){
steps {
script {
if (!params.VERSION) {
error('Not releasing')
}
}
withMaven {
sh "VERSION=${params.VERSION}"
sh '''
cd jakarta.jdt
./mvnw -Dtycho.mode=maven org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=$VERSION
./mvnw versions:set-scm-tag -DnewTag=$VERSION
./mvnw clean deploy -B -Peclipse-sign -Dcbi.jarsigner.skip=false
cd ../jakarta.ls
./mvnw -Dtycho.mode=maven org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=$VERSION
./mvnw versions:set-scm-tag -DnewTag=$VERSION
./mvnw clean deploy -B -Peclipse-sign -Dcbi.jarsigner.skip=false
cd ../jakarta.eclipse
./mvnw -Dtycho.mode=maven org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=$VERSION
cd ..
'''
}
}
}
stage('Deploy to downloads.eclipse.org') {
steps {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh "VERSION=${params.VERSION}"
sh '''
targetDir=/home/data/httpd/download.eclipse.org/lsp4jakarta/releases/$VERSION
ssh genie.lsp4jakarta@projects-storage.eclipse.org rm -rf $targetDir
ssh genie.lsp4jakarta@projects-storage.eclipse.org mkdir -p $targetDir
scp -r jakarta.jdt/org.eclipse.lsp4jakarta.jdt.site/target/*.zip genie.lsp4jakarta@projects-storage.eclipse.org:$targetDir
ssh genie.lsp4jakarta@projects-storage.eclipse.org unzip $targetDir/*.zip -d $targetDir/repository
'''
}
//Push release to latest
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh "VERSION=latest"
sh '''
targetDir=/home/data/httpd/download.eclipse.org/lsp4jakarta/releases/$VERSION
ssh genie.lsp4jakarta@projects-storage.eclipse.org rm -rf $targetDir
ssh genie.lsp4jakarta@projects-storage.eclipse.org mkdir -p $targetDir
scp -r jakarta.jdt/org.eclipse.lsp4jakarta.jdt.site/target/*.zip genie.lsp4jakarta@projects-storage.eclipse.org:$targetDir
ssh genie.lsp4jakarta@projects-storage.eclipse.org unzip $targetDir/*.zip -d $targetDir/repository
'''
}
}
}
stage('Push tag to git') {
steps {
sshagent(['github-bot-ssh']) {
sh "VERSION=${params.VERSION}"
sh '''
git config --global user.email "lsp4jakarta-bot@eclipse.org"
git config --global user.name "LSP4Jakarta GitHub Bot"
git add "**/pom.xml" "**/MANIFEST.MF" "**/feature.xml"
git commit -sm "Release $VERSION"
git tag $VERSION
git push origin $VERSION
'''
}
}
}
stage("Update to next development version"){
steps {
withMaven {
sh "$VERSION_SNAPSHOT=${params.VERSION_SNAPSHOT}"
sh '''
cd jakarta.jdt
./mvnw -Dtycho.mode=maven org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=$VERSION_SNAPSHOT
./mvnw versions:set-scm-tag -DnewTag=$VERSION_SNAPSHOT
cd ../jakarta.ls
./mvnw -Dtycho.mode=maven org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=$VERSION_SNAPSHOT
./mvnw versions:set-scm-tag -DnewTag=$VERSION_SNAPSHOT
cd ../jakarta.eclipse
./mvnw -Dtycho.mode=maven org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=$VERSION_SNAPSHOT
cd ..
'''
}
}
}
stage('Push next development version') {
steps {
sshagent(['github-bot-ssh']) {
sh "$VERSION_SNAPSHOT=${params.$VERSION_SNAPSHOT}"
sh '''
git config --global user.email "lsp4jakarta-bot@eclipse.org"
git config --global user.name "LSP4Jakarta GitHub Bot"
git add "**/pom.xml" "**/MANIFEST.MF" "**/feature.xml"
git commit -sm "New Development $VERSION_SNAPSHOT"
git push origin
'''
}
}
}
}
}