-
Notifications
You must be signed in to change notification settings - Fork 66
/
PublishPlatformToMaven.groovy
78 lines (63 loc) · 2.04 KB
/
PublishPlatformToMaven.groovy
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
job('Releng/PublishPlatformToMaven'){
displayName('Publish Platform to Maven')
description('Publish artifacts in groupId org.eclipse.platform to staging of OSSRH.')
parameters {
stringParam('REPO_ID', null, 'ID (buildNo) of repository created by CBI aggregator job.')
}
label('centos-latest')
jdk('openjdk-jdk11-latest')
logRotator {
numToKeep(5)
}
wrappers { //adds pre/post actions
preBuildCleanup()
credentialsBinding {
file('KEYRING', 'secret-subkeys.asc (secret-subkeys.asc for Releng')
}
timestamps()
sshAgent('git.eclipse.org-bot-ssh', 'github-bot-ssh')
}
steps {
shell('''
#!/bin/bash -x
#*******************************************************************************
# Copyright (c) 2016 GK Software AG and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# Stephan Herrmann - initial API and implementation
#********************************************************************************
unset JAVA_TOOL_OPTIONS
unset _JAVA_OPTIONS
# Trust GPG keys
gpg --batch --import "${KEYRING}"
for fpr in $(gpg --list-keys --with-colons | awk -F: '/for:/ {print $10}' | sort -u)
do
echo -e "5\\ny\\n" | gpg --batch --command-fd 0 --expert --edit-key ${fpr} trust
done
# BOOTSTRAP:
GIT_URL=git@github.com:eclipse-platform/eclipse.platform.releng.git
GIT_REL_PATH=eclipse.platform.releng/publish-to-maven-central
SCRIPT=publishPlatform.sh
BASELINE=baseline.txt
POM=platform-pom.xml
# -------- fetch script & pom: -------------
git clone -b master ${GIT_URL}
/bin/mv ${GIT_REL_PATH}/${SCRIPT} ${WORKSPACE}/
/bin/mv ${GIT_REL_PATH}/${BASELINE} ${WORKSPACE}/
/bin/mv ${GIT_REL_PATH}/${POM} ${WORKSPACE}/
/bin/rmdir -p --ignore-fail-on-non-empty ${GIT_REL_PATH}
env
chmod 744 ${SCRIPT}
bash -x ./${SCRIPT}
''')
}
publishers {
archiveArtifacts {
pattern('.log/*')
}
}
}