What's the simplest, secure, step-by-step approach to giving Jenkins 2.x access to the credentials needed for fastlane
+ sigh
?
I inherited a Jenkins 1.x installation and decided to upgrade to 2.x. We have several iOS projects that were building and pushing to HockeyApp/TestFlight without issues, but I had some free time and I figured it'd be better to upgrade from 1.x to 2.x now rather than having to do 1.x to 3.x later.
Not knowing how the original installation had been done, it seemed safest to just use the packaged installer, so I downloaded the binary for 2.32.3 and stepped through the wizard.
In order to test the upgrade, I logged into the web interface, navigated to an iOS project managed by Fastlane, and clicked "Rebuild last". The build failed almost immediately:
Missing password for user [email protected], and running in non-interactive shell
+------+-------------------------------------+-------------+
| fastlane summary |
+------+-------------------------------------+-------------+
| Step | Action | Time (in s) |
+------+-------------------------------------+-------------+
| 1 | Verifying required fastlane version | 0 |
| 2 | default_platform | 0 |
| 3 | xcversion | 0 |
| 💥 | sigh | 0 |
+------+-------------------------------------+-------------+
...
/usr/local/lib/ruby/gems/2.3.0/gems/fastlane-2.25.0/credentials_manager/lib/
credentials_manager/account_manager.rb:125:in `ask_for_login': [!] Missing
password for user [email protected], and running in non-interactive
shell (RuntimeError)
...
After quite a lot of googling, I've tried following a few suggestions, all with no luck. At this point I'm concerned that I'll just end up breaking things because all of the solutions I've encountered are multi-step, across multiple domains (jenkins, keychain, shell commands), and lacking in any what-could-go-wrong-when-trying-this-solution-and-how-to-recover context.
In short, I'm almost at the end of my rope. Or, as the saying goes, I've got just enough rope to hang myself…and I'd rather not. 😬
Try setting these environment variables.
FASTLANE_USER: Your App Store Connect / Apple Developer Portal user, if your/fastlane/setup accesses App Store Connect or the Apple Developer Portal (e.g. submit a TestFlight build, create a profile, …)
FASTLANE_PASSWORD: Your App Store Connect / Apple Developer Portal password, usually only needed if you also set theFASTLANE_USERvariable
To generate a web session for your CI machine, use fastlane spaceauth -u [email protected]
This will authenticate you and provide a string that can be transferred to your CI system. Copy everything from—\nto your CI server and provide it as environment variable named FASTLANE_SESSION
FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: You need to provide an application specific password if you have 2-factor enabled and use pilot or deliver to upload a binary to App Store Connect
For further details refer this https://docs.fastlane.tools/best-practices/continuous-integration/#environment-variables-to-set
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With