Anonymous avatar Anonymous committed 6cb9759

Read password for developer keychain from build-secrets repo and use it to unlock keychain.
Only unlock and code sign if running under Team City.

Comments (0)

Files changed (1)


             identity = self.args['signature']
             if identity == '':
                 identity = 'Developer ID Application'
-            self.run_command('codesign --force --sign %(identity)r %(bundle)r' % {
-							'identity': identity,
-							'bundle': self.get_dst_prefix()
-			})
+            # Look for an environment variable set via when running in Team City.
+            try:
+                build_secrets_checkout = os.environ['build_secrets_checkout']
+            except KeyError:
+                pass
+            else:
+                # variable found so use it to unlock keyvchain followed by codesign
+                home_path = os.environ['HOME']
+                keychain_pwd_path = os.path.join(build_secrets_checkout,'code-signing-osx'.'password.txt')
+                keychain_pwd = open(keychain_pwd_path).read().rstrip()
+                self.run_command('security unlock-keychain -p "%s" "%s/Library/Keychains/developer.keychain"' % ( keychain_pwd, home_path ) )
+                self.run_command('codesign --force --sign --verboose %(identity)r %(bundle)r' % {
+                                 'identity': identity,
+                                  'bundle': self.get_dst_prefix()
+                })
         channel_standin = 'Second Life Viewer'  # hah, our default channel is not usable on its own
         if not self.default_channel():
             channel_standin =
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.