-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathRelease.Jenkinsfile
70 lines (67 loc) · 2.24 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
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?')
}
stages {
stage("Release LSP4MP Language Server"){
steps {
script {
if (!params.VERSION) {
error('Not releasing')
}
}
withMaven {
sh "VERSION=${params.VERSION}"
sh '''
cd microprofile.ls/org.eclipse.lsp4mp.ls
./mvnw versions:set -DnewVersion=$VERSION
./mvnw versions:set-scm-tag -DnewTag=$VERSION
./mvnw clean deploy -B -Peclipse-sign -Dcbi.jarsigner.skip=false
cd ../../microprofile.jdt
./mvnw org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=$VERSION-SNAPSHOT
./mvnw versions:set-scm-tag -DnewTag=$VERSION
./mvnw clean verify -B -Peclipse-sign -DskipTests
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/lsp4mp/releases/$VERSION
ssh genie.lsp4mp@projects-storage.eclipse.org rm -rf $targetDir
ssh genie.lsp4mp@projects-storage.eclipse.org mkdir -p $targetDir
scp -r microprofile.jdt/org.eclipse.lsp4mp.jdt.site/target/*.zip genie.lsp4mp@projects-storage.eclipse.org:$targetDir
ssh genie.lsp4mp@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 "lsp4mp-bot@eclipse.org"
git config --global user.name "LSP4MP GitHub Bot"
git add "**/pom.xml" "**/MANIFEST.MF"
git commit -sm "Release $VERSION"
git tag $VERSION
git push origin $VERSION
'''
}
}
}
}
}