Refactor Publish Repository stage in Jenkinsfile to update GPG passphrase handling and improve publishing logic

This commit is contained in:
2026-07-16 11:33:34 +02:00
parent ba57144570
commit d4dc60a194
Vendored
+9 -9
View File
@@ -56,22 +56,22 @@ pipeline {
stage("Publish Repository") { stage("Publish Repository") {
steps { steps {
sshagent(['srv01_elordenador_org']) { sshagent(['srv01_elordenador_org']) {
withCredentials([ withCredentials([
string( string(
credentialsId: 'aptly_gpg_pass', credentialsId: 'espos-gpg-passphrase',
variable: 'GPG_PASS' variable: 'GPG_PASS'
) )
]) { ]) {
sh ''' sh '''
ssh ${APTLY_HOST} << EOF ssh ${APTLY_HOST} "GPG_PASS='$GPG_PASS' bash -s" << 'EOF'
aptly repo add espos-unstable /tmp/*.deb aptly repo add espos-unstable /tmp/*.deb
if aptly publish list | grep -q espos-unstable if aptly publish list | grep -q espos-unstable
then then
aptly publish switch \ aptly publish update \
-passphrase="$GPG_PASS" \ -passphrase="$GPG_PASS" \
espos-unstable espos-unstable
else else
@@ -81,13 +81,13 @@ pipeline {
-passphrase="$GPG_PASS" \ -passphrase="$GPG_PASS" \
espos-unstable espos-unstable
fi fi
EOF EOF
''' '''
} }
} }
} }
} }
} }
post { post {
success { success {