Skip to content

Commit

Permalink
Simplify pgp sign
Browse files Browse the repository at this point in the history
  • Loading branch information
akurtakov committed Sep 27, 2024
1 parent 4ff328a commit ca976ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
25 changes: 3 additions & 22 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,22 @@ pipeline {
}
tools {
maven 'apache-maven-3.9.9'
jdk 'openjdk-jdk21-latest'
jdk 'temurin-jdk21-latest'
}
stages {
stage('get m2e-core-tests') {
steps {
sh 'git submodule update --init --recursive --remote'
}
}
stage('initialize PGP') {
when {
anyOf{
branch 'master';
branch pattern: 'm2e-[0-9]+\\.[0-9]+\\.x', comparator: "REGEXP"
}
}
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
'''
}
}
}
stage('Build') {
steps {
withCredentials([string(credentialsId: 'gpg-passphrase', variable: 'KEYRING_PASSPHRASE')]) {
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING'),string(credentialsId: 'gpg-passphrase', variable: 'KEYRING_PASSPHRASE')]) {
xvnc(useXauthority: true) {
sh '''
mavenArgs="clean verify --batch-mode -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true -Dtycho.p2.baselineMode=failCommon"
if [[ ${BRANCH_NAME} == master ]] || [[ ${BRANCH_NAME} =~ m2e-[0-9]+\\.[0-9]+\\.x ]]; then
mvn ${mavenArgs} -Peclipse-sign,its -Dgpg.passphrase="${KEYRING_PASSPHRASE}" -Dgpg.keyname="011C526F29B2CE79"
mvn ${mavenArgs} -Peclipse-sign,its -DDtycho.pgp.signer.bc.secretKeys="${KEYRING}" -Dgpg.passphrase="${KEYRING_PASSPHRASE}" -Dgpg.keyname="011C526F29B2CE79"
else
# Clear KEYRING_PASSPHRASE environment variable
export KEYRING_PASSPHRASE='EMPTY'
Expand Down
1 change: 1 addition & 0 deletions org.eclipse.m2e.repository/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
<goal>sign-p2-artifacts</goal>
</goals>
<configuration>
<signer>bc</signer>
<skipIfJarsigned>true</skipIfJarsigned>
</configuration>
</execution>
Expand Down

0 comments on commit ca976ab

Please sign in to comment.