-
Notifications
You must be signed in to change notification settings - Fork 321
/
Copy pathJenkinsfile
72 lines (65 loc) · 2.13 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
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr:'15'))
disableConcurrentBuilds()
timeout(time: 120, unit: 'MINUTES')
}
parameters {
choice(name: 'RELEASE_TYPE', choices: ['M0', 'M1', 'M2', 'M3', 'RC1', 'RC2', 'GA'], description:
'''
Kind of milestone release to build.
''')
booleanParam(name: 'P2_DEPLOY_DRY_RUN', defaultValue: false, description:
'''
If set, the composite update site is created/updated locally (and archived), but it will
not be uploaded to the remote area: rsync will be executed with "--dry-run, -n"
''')
}
environment {
DOWNLOAD_AREA = '/home/data/httpd/download.eclipse.org/modeling/tmf/xtext'
REPOSITORY_PATH="${DOWNLOAD_AREA}/updates/milestones"
}
tools {
maven "apache-maven-3.8.6"
jdk "temurin-jdk17-latest"
}
stages {
stage('Prepare download area') {
steps {
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
sh '''
echo ${REPOSITORY_PATH}
ssh [email protected] "mkdir -p $REPOSITORY_PATH"
'''
}
}
}
stage('Prepare versions for Milestone') {
steps {
sh './scripts/prepare-for-milestone.sh ${RELEASE_TYPE}'
}
}
stage('Maven Tycho Build, Sign, Deploy') {
steps {
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING')]) {
sh 'gpg --batch --import "${KEYRING}"'
sh 'for fpr in $(gpg --list-keys --with-colons | awk -F: \'/fpr:/ {print $10}\' | sort -u); do echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key ${fpr} trust; done'
}
sshagent(['projects-storage.eclipse.org-bot-ssh']) {
sh """
./full-deploy.sh -Peclipse-sign,sonatype-oss-release,release-milestone ${rsyncAdditionalArgs()}
"""
}
}
}
}
post {
success {
archiveArtifacts artifacts: 'build/**, org.eclipse.xtext.p2repository/target/checkout/**'
}
}
}
def rsyncAdditionalArgs() {
return params.P2_DEPLOY_DRY_RUN ? '-Dadditional-rsync-commit-args="-n"' : ''
}