Refactor Publish Repository stage in Jenkinsfile to streamline GPG passphrase usage and improve command structure
This commit is contained in:
Vendored
+15
-17
@@ -65,24 +65,22 @@ pipeline {
|
|||||||
]) {
|
]) {
|
||||||
|
|
||||||
sh '''
|
sh '''
|
||||||
ssh ${APTLY_HOST} "GPG_PASS='$GPG_PASS' bash -s" << 'EOF'
|
ssh ${APTLY_HOST} "
|
||||||
|
aptly repo add espos-unstable /tmp/*.deb
|
||||||
|
|
||||||
aptly repo add espos-unstable /tmp/*.deb
|
if aptly publish list | grep -q espos-unstable
|
||||||
|
then
|
||||||
if aptly publish list | grep -q espos-unstable
|
aptly publish update \
|
||||||
then
|
-passphrase='${GPG_PASS}' \
|
||||||
aptly publish update \
|
espos-unstable
|
||||||
-passphrase="$GPG_PASS" \
|
else
|
||||||
espos-unstable
|
aptly publish repo \
|
||||||
else
|
-distribution=espos-unstable \
|
||||||
aptly publish repo \
|
-component=main \
|
||||||
-distribution=espos-unstable \
|
-passphrase='${GPG_PASS}' \
|
||||||
-component=main \
|
espos-unstable
|
||||||
-passphrase="$GPG_PASS" \
|
fi
|
||||||
espos-unstable
|
"
|
||||||
fi
|
|
||||||
|
|
||||||
EOF
|
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user