Skip to content

Commit

Permalink
Fix gpg signing
Browse files Browse the repository at this point in the history
  • Loading branch information
akurtakov committed Aug 28, 2024
1 parent 77de7d8 commit 6892958
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 25 deletions.
13 changes: 2 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,12 @@ spec:
MAVEN_OPTS = "-Xmx2G"
}
stages {
stage('Initialize PGP') {
steps {
container('container') {
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 {
container('container') {
withCredentials([string(credentialsId: 'gpg-passphrase', variable: 'KEYRING_PASSPHRASE')]) {
withCredentials([file(credentialsId: 'secret-subkeys.asc', variable: 'KEYRING'),string(credentialsId: 'gpg-passphrase', variable: 'KEYRING_PASSPHRASE') ]) {
wrap([$class: 'Xvnc', useXauthority: true]) {
sh """mvn clean verify -e ${env.BRANCH_NAME=='master' ? '-Psign': ''} -Dmaven.test.failure.ignore=true -ntp -Ddash.fail=true -Dgpg.passphrase="${KEYRING_PASSPHRASE}" """
sh '''mvn -e -Psign -Dmaven.test.failure.ignore=true -ntp -Ddash.fail=true -Dgpg.passphrase="${KEYRING_PASSPHRASE}" -Dtycho.pgp.signer.bc.secretKeys="${KEYRING}" clean verify'''
}
}}
}
Expand Down
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,9 @@
<goal>sign-p2-artifacts</goal>
</goals>
<configuration>
<keyname>F5CBCFD82F07D82E</keyname>
<skipIfJarsigned>false</skipIfJarsigned>
<signer>bc</signer>
<keyname>2F07D82E</keyname>
<skipIfJarsigned>true</skipIfJarsigned>
</configuration>
</execution>
</executions>
Expand Down
12 changes: 0 additions & 12 deletions releng/org.eclipse.linuxtools.docker-site/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,6 @@
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-gpg-plugin</artifactId>
<executions>
<execution>
<id>pgpsigner</id>
<goals>
<goal>sign-p2-artifacts</goal>
</goals>
<configuration>
<keyname>F5CBCFD82F07D82E</keyname>
<skipIfJarsigned>false</skipIfJarsigned>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down

0 comments on commit 6892958

Please sign in to comment.