Skip to content

Commit 6c510b0

Browse files
committed
[I/Y-Build] Simplify GPG-signing in I/Y-builds
Importing the secret-key is not necessary when signing with the bouncy-castle (BC) signer. Therefore just import the key where the gpg executable is used (i.e. when signing the list of artifact checksums).
1 parent 7b86b63 commit 6c510b0

File tree

7 files changed

+11
-47
lines changed

7 files changed

+11
-47
lines changed

JenkinsJobs/Builds/build.jenkinsfile

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -97,24 +97,6 @@ spec:
9797
}
9898
}
9999
}
100-
stage('Load PGP keys'){
101-
environment {
102-
KEYRING = credentials('secret-subkeys-releng.asc')
103-
KEYRING_PASSPHRASE = credentials('secret-subkeys-releng.asc-passphrase')
104-
}
105-
steps {
106-
dir("${CJE_ROOT}/mbscripts") {
107-
sh '''
108-
./mb011_loadPGPKeys.sh 2>&1 | tee $logDir/mb011_loadPGPKeys.sh.log
109-
if [[ ${PIPESTATUS[0]} -ne 0 ]]
110-
then
111-
echo "Failed in Load PGP keys"
112-
exit 1
113-
fi
114-
'''
115-
}
116-
}
117-
}
118100
stage('Export environment variables stage 1'){
119101
steps {
120102
script {

JenkinsJobs/YBuilds/P_build.groovy

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -105,25 +105,6 @@ spec:
105105
}
106106
}
107107
}
108-
stage('Load PGP keys'){
109-
environment {
110-
KEYRING = credentials('secret-subkeys-releng.asc')
111-
KEYRING_PASSPHRASE = credentials('secret-subkeys-releng.asc-passphrase')
112-
}
113-
steps {
114-
container('jnlp') {
115-
sh \'\'\'
116-
cd ${WORKSPACE}/eclipse.platform.releng.aggregator/eclipse.platform.releng.aggregator/cje-production/mbscripts
117-
./mb011_loadPGPKeys.sh 2>&1 | tee $logDir/mb011_loadPGPKeys.sh.log
118-
if [[ ${PIPESTATUS[0]} -ne 0 ]]
119-
then
120-
echo "Failed in Load PGP keys"
121-
exit 1
122-
fi
123-
\'\'\'
124-
}
125-
}
126-
}
127108
stage('Export environment variables stage 1'){
128109
steps {
129110
container('jnlp') {

cje-production/P-build/mb220_buildSdkPatch.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ mvn -f eclipse.platform.releng.tychoeclipsebuilder/${PATCH_OR_BRANCH_LABEL}/pom.
3939
-Dtycho.debug.artifactcomparator \
4040
-Dtycho.localArtifacts=ignore \
4141
-Dcbi.jarsigner.continueOnFail=true \
42+
-Dtycho.pgp.signer=bc -Dtycho.pgp.signer.bc.secretKeys="${KEYRING}" \
4243
-Djgit.dirtyWorkingTree=error \
4344
-Dmaven.repo.local=$LOCAL_REPO \
4445
-Djava.io.tmpdir=$CJE_ROOT/$TMP_DIR \

cje-production/mbscripts/mb011_loadPGPKeys.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

cje-production/mbscripts/mb220_buildSdkPatch.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ mvn clean verify -DskipTests=true ${MVN_ARGS} \
3636
-Dtycho.debug.artifactcomparator \
3737
-Dtycho.localArtifacts=ignore \
3838
-Dcbi.jarsigner.continueOnFail=true \
39+
-Dtycho.pgp.signer=bc -Dtycho.pgp.signer.bc.secretKeys="${KEYRING}" \
3940
-Djgit.dirtyWorkingTree=error \
4041
-Dmaven.repo.local=$LOCAL_REPO \
4142
-Djava.io.tmpdir=$CJE_ROOT/$TMP_DIR \

eclipse.platform.releng.tychoeclipsebuilder/eclipse/extras/produceChecksum.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ echo "[DEBUG] Producing GPG signatures starting."
4242
set -e
4343
if [ ! -z "${KEYRING_PASSPHRASE}" ]
4444
then
45+
#import gpg keys in fresh gpg-homedir
46+
gpg_home="${WORKSPACE}/tools/${client}/gpg/"
47+
mkdir -p ${gpg_home}
48+
alias gpg='gpg --homedir "${gpg_home}"'
49+
gpg --batch --import "${KEYRING}"
50+
for fpr in $(gpg --list-keys --with-colons | awk -F: '/fpr:/ {print $10}' | sort -u); do
51+
echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key "${fpr}" trust;
52+
done
53+
4554
gpg --detach-sign --armor --output ${allCheckSumsSHA512}.asc --batch --pinentry-mode loopback --passphrase-fd 0 ${allCheckSumsSHA512} <<< "${KEYRING_PASSPHRASE}"
4655
else
4756
# We don't treat as ERROR since would be normal in a "local build".

eclipse.platform.releng.tychoeclipsebuilder/pom.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@
4242
<artifactId>tycho-gpg-plugin</artifactId>
4343
<version>${tycho.version}</version>
4444
<configuration>
45-
<signer>bc</signer>
46-
<keyname>b6d3ab9bcc641282</keyname>
4745
<skipIfJarsigned>false</skipIfJarsigned>
4846
<skipIfJarsignedAndAnchored>true</skipIfJarsignedAndAnchored>
4947
<pgpKeyBehavior>skip</pgpKeyBehavior>

0 commit comments

Comments
 (0)