Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add a field for entering code signing identity #6

Merged
merged 2 commits into from

7 participants

@katzj

Code signing identities are often something you'd want
to specify differently for an automated build (eg, so your
developers can just have developer certs but jenkins can
set up for distributing builds)

@katzj katzj Add a field for entering code signing identity
Code signing identities are often something you'd want
to specify differently for an automated build (eg, so your
developers can just have developer certs but jenkins can
set up for distributing builds)
7df3f35
@aheritier aheritier commented on the diff
src/main/java/au/com/rayh/XCodeBuilder.java
@@ -389,6 +394,14 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListener lis
xcodeReport.append(", configurationBuildDir: DEFAULT");
}
+ // handle code signing identities
+ if (!StringUtils.isEmpty(codeSigningIdentity)) {
+ commandLine.add("CODE_SIGN_IDENTITY=" + codeSigningIdentity);
@aheritier Owner

Your fix might also help to fix this one : https://issues.jenkins-ci.org/browse/JENKINS-12800
But I'm not sure that it works if you have a space in codeSigningIdentity
Did you try it ?

@katzj
katzj added a note

In fact it does. It's not really the best fix (as there are other options) but that's actually what led me here. I took a few stabs at the regex and decided that this was a quicker path to something working ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@aheritier
Owner

Can you provide an help file also to document this new configuration field ??

@stephenc
Collaborator

What would be really cool is if the code signing identity data was stored using the credentials plugin and then transferred to the build slave when needed

@katzj

@aheritier yep, will add and update the pull request this morning.

@stephenc they have to be pulled from the os/x keychain so I'm not sure of any way to actually export/import in an automated fashion

@aheritier
Owner

I forgot the other pull request which I think was to solve the same issue. --sign and CODE_SIGN_IDENTITY have the same behavior no ?
Otherwise you pull-request seems ok, I will test it and merge it

@katzj

There is actually a slight difference from my understanding.

CODE_SIGN_IDENTITY has to do with how the .app gets signed. --sign is instead how the packaged .ipa is signed. The two can be different in some cases from what I understand

@aheritier
Owner

ok thus I'll keep the other, I'll have to study it more.

@aheritier aheritier merged commit 6af1b04 into from
@devguydavid

Any word on when a new release will be made with this feature in place?

@pyby

Any news for a release? I searched this feature on the web

@lacostej
Collaborator
@fwal

Any updates? Sadly this is a deal-breaker for me...

@lacostej
Collaborator

Have you guys tested the latest build ?

If nobody helps me testing the latest HEAD build on a production server, then you have to wait for me to test it :) As said above, I am in the end of a release cycle and will have time in a few days.

@fwal

Cool. :) I'll test it on our server now...

@fwal

Works perfectly for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 5, 2012
  1. @katzj

    Add a field for entering code signing identity

    katzj authored
    Code signing identities are often something you'd want
    to specify differently for an automated build (eg, so your
    developers can just have developer certs but jenkins can
    set up for distributing builds)
  2. @katzj

    Add a help file

    katzj authored
This page is out of date. Refresh to see the latest.
View
15 src/main/java/au/com/rayh/XCodeBuilder.java
@@ -129,10 +129,14 @@
* @since 1.0
*/
public final String keychainPwd;
+ /**
+ * @since 1.3.2
+ */
+ public final String codeSigningIdentity;
// Fields in config.jelly must match the parameter names in the "DataBoundConstructor"
@DataBoundConstructor
- public XCodeBuilder(Boolean buildIpa, Boolean cleanBeforeBuild, Boolean cleanTestReports, String configuration, String target, String sdk, String xcodeProjectPath, String xcodeProjectFile, String xcodebuildArguments, String embeddedProfileFile, String cfBundleVersionValue, String cfBundleShortVersionStringValue, Boolean unlockKeychain, String keychainPath, String keychainPwd, String symRoot, String xcodeWorkspaceFile, String xcodeSchema, String configurationBuildDir) {
+ public XCodeBuilder(Boolean buildIpa, Boolean cleanBeforeBuild, Boolean cleanTestReports, String configuration, String target, String sdk, String xcodeProjectPath, String xcodeProjectFile, String xcodebuildArguments, String embeddedProfileFile, String cfBundleVersionValue, String cfBundleShortVersionStringValue, Boolean unlockKeychain, String keychainPath, String keychainPwd, String symRoot, String xcodeWorkspaceFile, String xcodeSchema, String configurationBuildDir, String codeSigningIdentity) {
this.buildIpa = buildIpa;
this.sdk = sdk;
this.target = target;
@@ -145,6 +149,7 @@ public XCodeBuilder(Boolean buildIpa, Boolean cleanBeforeBuild, Boolean cleanTes
this.xcodeWorkspaceFile = xcodeWorkspaceFile;
this.xcodeSchema = xcodeSchema;
this.embeddedProfileFile = embeddedProfileFile;
+ this.codeSigningIdentity = codeSigningIdentity;
this.cfBundleVersionValue = cfBundleVersionValue;
this.cfBundleShortVersionStringValue = cfBundleShortVersionStringValue;
this.unlockKeychain = unlockKeychain;
@@ -389,6 +394,14 @@ public boolean perform(AbstractBuild build, Launcher launcher, BuildListener lis
xcodeReport.append(", configurationBuildDir: DEFAULT");
}
+ // handle code signing identities
+ if (!StringUtils.isEmpty(codeSigningIdentity)) {
+ commandLine.add("CODE_SIGN_IDENTITY=" + codeSigningIdentity);
@aheritier Owner

Your fix might also help to fix this one : https://issues.jenkins-ci.org/browse/JENKINS-12800
But I'm not sure that it works if you have a space in codeSigningIdentity
Did you try it ?

@katzj
katzj added a note

In fact it does. It's not really the best fix (as there are other options) but that's actually what led me here. I took a few stabs at the regex and decided that this was a quicker path to something working ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ xcodeReport.append(", codeSignIdentity: ").append(codeSigningIdentity);
+ } else {
+ xcodeReport.append(", codeSignIdentity: DEFAULT");
+ }
+
// Additional (custom) xcodebuild arguments
if (!StringUtils.isEmpty(xcodebuildArguments)) {
String[] parts = xcodebuildArguments.split("[ ]");
View
5 src/main/resources/au/com/rayh/XCodeBuilder/config.jelly
@@ -104,6 +104,11 @@
<f:checkbox />
</f:entry>
+ <f:entry title="${%Code Signing Identity}" field="codeSigningIdentity"
+ description="Override the code signing identity specified in the project">
+ <f:textbox />
+ </f:entry>
+
<f:entry title="${%Embedded Profile}" field="embeddedProfileFile"
description="The relative path to the mobileprovision to embed, leave blank for no embedded profile">
<f:textbox />
View
33 src/main/resources/au/com/rayh/XCodeBuilder/help-codeSigningIdentity.html
@@ -0,0 +1,33 @@
+<!--
+ ~ The MIT License
+ ~
+ ~ Copyright (c) 2011 Ray Yamamoto Hilton
+ ~
+ ~ Permission is hereby granted, free of charge, to any person obtaining a copy
+ ~ of this software and associated documentation files (the "Software"), to deal
+ ~ in the Software without restriction, including without limitation the rights
+ ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ ~ copies of the Software, and to permit persons to whom the Software is
+ ~ furnished to do so, subject to the following conditions:
+ ~
+ ~ The above copyright notice and this permission notice shall be included in
+ ~ all copies or substantial portions of the Software.
+ ~
+ ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ ~ THE SOFTWARE.
+ -->
+
+<div>
+ <p>
+ Override the code signing identity specified within the project config.
+
+ This lets you keep your xcode project setup to build with developer certificates
+ interactively but put your distribution certificate on the hosts running jenkins
+ to build your actual releases.
+ </p>
+</div>
Something went wrong with that request. Please try again.