Skip to content

Commit ca976ab

Browse files
committed
Simplify pgp sign
1 parent 4ff328a commit ca976ab

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

Jenkinsfile

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,22 @@ pipeline {
1010
}
1111
tools {
1212
maven 'apache-maven-3.9.9'
13-
jdk 'openjdk-jdk21-latest'
13+
jdk 'temurin-jdk21-latest'
1414
}
1515
stages {
1616
stage('get m2e-core-tests') {
1717
steps {
1818
sh 'git submodule update --init --recursive --remote'
1919
}
2020
}
21-
stage('initialize PGP') {
22-
when {
23-
anyOf{
24-
branch 'master';
25-
branch pattern: 'm2e-[0-9]+\\.[0-9]+\\.x', comparator: "REGEXP"
26-
}
27-
}
28-
steps {
29-
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING')]) {
30-
sh 'gpg --batch --import "${KEYRING}"'
31-
sh '''
32-
for fpr in $(gpg --list-keys --with-colons | awk -F: \'/fpr:/ {print $10}\' | sort -u)
33-
do
34-
echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key ${fpr} trust
35-
done
36-
'''
37-
}
38-
}
39-
}
4021
stage('Build') {
4122
steps {
42-
withCredentials([string(credentialsId: 'gpg-passphrase', variable: 'KEYRING_PASSPHRASE')]) {
23+
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING'),string(credentialsId: 'gpg-passphrase', variable: 'KEYRING_PASSPHRASE')]) {
4324
xvnc(useXauthority: true) {
4425
sh '''
4526
mavenArgs="clean verify --batch-mode -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true -Dtycho.p2.baselineMode=failCommon"
4627
if [[ ${BRANCH_NAME} == master ]] || [[ ${BRANCH_NAME} =~ m2e-[0-9]+\\.[0-9]+\\.x ]]; then
47-
mvn ${mavenArgs} -Peclipse-sign,its -Dgpg.passphrase="${KEYRING_PASSPHRASE}" -Dgpg.keyname="011C526F29B2CE79"
28+
mvn ${mavenArgs} -Peclipse-sign,its -DDtycho.pgp.signer.bc.secretKeys="${KEYRING}" -Dgpg.passphrase="${KEYRING_PASSPHRASE}" -Dgpg.keyname="011C526F29B2CE79"
4829
else
4930
# Clear KEYRING_PASSPHRASE environment variable
5031
export KEYRING_PASSPHRASE='EMPTY'

org.eclipse.m2e.repository/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
<goal>sign-p2-artifacts</goal>
8787
</goals>
8888
<configuration>
89+
<signer>bc</signer>
8990
<skipIfJarsigned>true</skipIfJarsigned>
9091
</configuration>
9192
</execution>

0 commit comments

Comments
 (0)