-
Notifications
You must be signed in to change notification settings - Fork 18
/
Jenkinsfile
94 lines (93 loc) · 3.89 KB
/
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
pipeline {
agent {
kubernetes {
label 'ubuntu-latest'
}
}
triggers {
pollSCM('H/5 * * * *')
}
parameters {
booleanParam(name: 'CLEAN_INTEGRATION', defaultValue: false, description: 'Attention: Cleans the integration folder with all branches completely.')
booleanParam(name: 'CODESIGN', defaultValue: false, description: 'Sign the artifacts.')
booleanParam(name: 'PUBLISH_PRODUCTS', defaultValue: false, description: 'Copy to the compiled products for Windows, macOS and Linux')
}
tools {
maven 'apache-maven-latest'
jdk 'temurin-jdk17-latest'
}
environment {
MAVEN_OPTS = '-Xmx2048m'
}
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '5', artifactNumToKeepStr: '1'))
}
stages {
stage('build') {
steps {
sh """
mvn -B ${params.CODESIGN ? '-P eclipse-sign' : ''} \\
-Dtycho.localArtifacts=ignore \\
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \\
-Dmaven.test.failure.ignore=true \\
-Dmaven.repo.local=$WORKSPACE/.mvn \\
-f chemclipse/releng/org.eclipse.chemclipse.aggregator/pom.xml \\
clean install
"""
archiveArtifacts 'chemclipse/products/org.eclipse.chemclipse.rcp.compilation.community.product/target/products/*.zip,chemclipse/products/org.eclipse.chemclipse.rcp.compilation.community.product/target/products/*.tar.gz'
}
}
stage('clean integration') {
when {
environment name: 'CLEAN_INTEGRATION', value: 'true'
}
steps {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh "ssh [email protected] rm -rf /home/data/httpd/download.eclipse.org/chemclipse/integration/"
}
}
}
stage('clean deploy') {
when {
environment name: 'CLEAN_WORKSPACE', value: 'true'
}
steps {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh "ssh [email protected] rm -rf /home/data/httpd/download.eclipse.org/chemclipse/integration/${BRANCH_NAME}"
}
}
}
stage('deploy') {
steps {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh '''
ssh [email protected] mkdir -p /home/data/httpd/download.eclipse.org/chemclipse/integration/${BRANCH_NAME}/repository
ssh [email protected] mkdir -p /home/data/httpd/download.eclipse.org/chemclipse/integration/${BRANCH_NAME}/downloads
scp -r chemclipse/sites/chemclipse/target/repository/* [email protected]:/home/data/httpd/download.eclipse.org/chemclipse/integration/${BRANCH_NAME}/repository
'''
}
}
}
stage('publish') {
when {
environment name: 'PUBLISH_PRODUCTS', value: 'true'
}
steps {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh '''
scp chemclipse/products/org.eclipse.chemclipse.rcp.compilation.community.product/target/products/chemclipse-win32.win32.x86_64.zip [email protected]:/home/data/httpd/download.eclipse.org/chemclipse/integration/${BRANCH_NAME}/downloads/chemclipse-win32.win32.x86_64.zip
scp chemclipse/products/org.eclipse.chemclipse.rcp.compilation.community.product/target/products/chemclipse-linux.gtk.x86_64.tar.gz [email protected]:/home/data/httpd/download.eclipse.org/chemclipse/integration/${BRANCH_NAME}/downloads/chemclipse-linux.gtk.x86_64.tar.gz
scp chemclipse/products/org.eclipse.chemclipse.rcp.compilation.community.product/target/products/chemclipse-macosx.cocoa.x86_64.tar.gz [email protected]:/home/data/httpd/download.eclipse.org/chemclipse/integration/${BRANCH_NAME}/downloads/chemclipse-macosx.cocoa.x86_64.tar.gz
'''
}
}
}
}
post {
always {
junit allowEmptyResults: true, testResults: '**/target/surefire-reports/*.xml'
recordIssues publishAllIssues: true, tools: [java(), mavenConsole(), javaDoc()]
}
}
}