Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 34855c6

Browse files
committed
more keychain debugging
1 parent b2b4f28 commit 34855c6

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

jenkins/Jenkinsfile.macos

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ pipeline {
101101

102102
environment {
103103
AWS_ACCOUNT_ID = '749683154838'
104-
KEYCHAIN_PASSPHRASE = credentials('ide-keychain-passphrase')
105104
KEYCHAIN_PATH = "${WORKSPACE}/buildagent.keychain"
105+
KEYCHAIN_PASSPHRASE = credentials('ide-keychain-passphrase')
106106
MACOS_DEVELOPER_CERTIFICATE = credentials('MACOS_DEVELOPER_CERTIFICATE')
107107
MACOS_DEVELOPER_CERTIFICATE_KEY = credentials('MACOS_DEVELOPER_CERTIFICATE_KEY')
108108
}
@@ -113,8 +113,6 @@ pipeline {
113113
}
114114
script {
115115
sh '''
116-
set -e
117-
118116
# Set up a keychain to hold our credentials
119117
security create-keychain -p "${KEYCHAIN_PASSPHRASE}" "${KEYCHAIN_PATH}"
120118
security unlock-keychain -p "${KEYCHAIN_PASSPHRASE}" "${KEYCHAIN_PATH}"
@@ -126,8 +124,16 @@ pipeline {
126124
-P "${MACOS_DEVELOPER_CERTIFICATE_KEY}" \
127125
-T /usr/bin/codesign
128126

129-
# Validate the available identity
127+
# Allow access to keychain without prompting
128+
security set-key-partition-list -S apple-tool:,apple: -s -k "${KEYCHAIN_PASSPHRASE}" "${KEYCHAIN_PATH}"
129+
130+
# Try to set this as the default keychain
130131
security list-keychains -s "${KEYCHAIN_PATH}"
132+
security default-keychain -s "${KEYCHAIN_PATH}"
133+
134+
# Validate the available identities
135+
security find-identity
136+
security find-identity "${KEYCHAIN_PATH}"
131137
'''
132138
}
133139
// Import the Developer ID certificate from Jenkins Secrets.

package/osx/cmake/codesign-package.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ endif()
4040
set(KEYCHAIN_PATH "$ENV{KEYCHAIN_PATH}")
4141
if(KEYCHAIN_PATH)
4242
echo("codesign: using keychain at ${KEYCHAIN_PATH}")
43+
execute_process(COMMAND "security find-identity ${KEYCHAIN_PATH}")
4344
list(APPEND CODESIGN_FLAGS --keychain "${KEYCHAIN_PATH}")
4445
else()
4546
echo("codesign: using default keychain search list")

0 commit comments

Comments
 (0)