forked from eclipse-lemminx/lemminx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Release.jenkins
48 lines (48 loc) · 1.56 KB
/
Release.jenkins
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
pipeline{
agent any
tools {
jdk 'adoptopenjdk-hotspot-jdk8-latest'
}
environment {
MAVEN_HOME = "$WORKSPACE/.m2/"
MAVEN_USER_HOME = "$MAVEN_HOME"
}
parameters {
booleanParam(name: 'PERFORM_RELEASE', defaultValue: false, description: 'Perform a release?')
}
stages {
stage("Maven Release"){
steps {
script {
if (!params.PERFORM_RELEASE) {
error('Not releasing')
}
}
sshagent ( ['github-bot-ssh']) {
withMaven {
sh '''
git config --global user.email "[email protected]"
git config --global user.name "LemMinX GitHub Bot"
./mvnw clean release:clean release:prepare -B
./mvnw clean release:perform -B
'''
}
}
}
}
stage('Deploy release to downloads.eclipse.org') {
steps {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh '''
base=./target/checkout/org.eclipse.lemminx/target/
version=`cat ${base}/maven-archiver/pom.properties | grep "version" | cut -d'=' -f2`
targetDir=/home/data/httpd/download.eclipse.org/lemminx/releases/${version}
ssh [email protected] mkdir -p $targetDir
scp -r ${base}/org.eclipse.lemminx-* [email protected]:$targetDir
ssh [email protected] unzip $targetDir/org.eclipse.lemminx-p2repo.zip -d $targetDir/repository
'''
}
}
}
}
}