-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathJenkinsfile
More file actions
80 lines (79 loc) · 3.6 KB
/
Copy pathJenkinsfile
File metadata and controls
80 lines (79 loc) · 3.6 KB
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
pipeline {
agent {
label 'ubuntu-latest'
}
triggers {
githubPush()
}
parameters {
booleanParam(name: 'JARSIGN', 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-jdk21-latest'
}
environment {
MAVEN_OPTS = '-Xmx2048m'
}
options {
disableConcurrentBuilds(abortPrevious: true)
buildDiscarder(logRotator(numToKeepStr: '5', artifactNumToKeepStr: '1'))
}
stages {
stage('Build') {
steps {
script {
def jarSign = params.JARSIGN ? '-P eclipse-sign' : ''
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING'), string(credentialsId: 'gpg-passphrase', variable: 'MAVEN_GPG_PASSPHRASE')]) {
sh '''
mvn \\
-B ${jarSign} -Pgpg-sign -Dtycho.pgp.signer.bc.secretKeys="${KEYRING}" \\
-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/pom.xml \\
-Pjavadoc \\
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('Deploy') {
steps {
sshagent ( ['projects-storage.eclipse.org-bot-ssh']) {
sh '''
ssh genie.chemclipse@projects-storage.eclipse.org rm -rf /home/data/httpd/download.eclipse.org/chemclipse/integration/${BRANCH_NAME}
ssh genie.chemclipse@projects-storage.eclipse.org mkdir -p /home/data/httpd/download.eclipse.org/chemclipse/integration/${BRANCH_NAME}/repository
ssh genie.chemclipse@projects-storage.eclipse.org mkdir -p /home/data/httpd/download.eclipse.org/chemclipse/integration/${BRANCH_NAME}/downloads
scp -r chemclipse/sites/chemclipse/target/repository/* genie.chemclipse@projects-storage.eclipse.org:/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 genie.chemclipse@projects-storage.eclipse.org:/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 genie.chemclipse@projects-storage.eclipse.org:/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 genie.chemclipse@projects-storage.eclipse.org:/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(),
taskScanner(normalTags: 'TODO', highTags: 'FIXME', includePattern: '**/*.java')]
}
}
}