Fastlane fails as bundler modifies Gemfile.lock so the directory is dirty

Description of the issue

Run Fastlane (bundle "exec" "fastlane" "deploy" "type:patch") modifies Gemfile.lock which blocks the build.

This looks like the same issue in CircleCI, which they fixed by updating the installed version of bundler.

Environment:

  • BitRise on Android & Docker, on Ubuntu 16.04

Which build Step causes the issue and which version of the step?

E.g.: Run Fastlane v2.3.12

Reproducibility

  • Does a “Rebuild” help? : NO
  • Does a rebuild without caches help? (You can remove the Cache:Pull and Cache:Push steps temporarily to not to use the cache, or you can delete all the caches on the Settings tab of the app. : NO
  • Does the issue happen sporadically, or every time? : every time
  • Does upgrading the build Step to the latest version help? : NO
  • When did the issue start? : not sure

Local reproduction

_Can it be reproduced on your own computer? No, issue is the bundler version on the CI platform

Build log

[13:30:49]: -------------------------------------
[13:30:49]: --- Step: ensure_git_status_clean ---
[13:30:49]: -------------------------------------
[13:30:49]: $ git status --porcelain
[13:30:49]: â–¸ M Gemfile.lock
+------------------+----------------+
|           Lane Context            |
+------------------+----------------+
| DEFAULT_PLATFORM | android        |
| PLATFORM_NAME    | android        |
| LANE_NAME        | android deploy |
| VERSION_NAME     | '1.8.0'        |
+------------------+----------------+
[13:30:49]: Git repository is dirty! Please ensure the repo is in a clean state by committing/stashing/discarding all changes first.
Uncommitted changes:
 M Gemfile.lock

Hey @PLN!

Did you try updating bundler in a script step?

Hi @tamaspapik, apologies I couldn’t come back to you earlier.

I got to try updating bundler in a script step, which didn’t work:

gem install bundler
ERROR: Error installing bundler:
“bundle” from bundler conflicts with /usr/local/bin/bundle

Is there another approach for updating bundler in a script step successfully?

What about doing a git checkout Gemfile.lock to restore the lock file’s content to the one committed into the repo?

Good call, that should work. I’ll let you know how it goes!

1 Like

Glad to hear - let us know how it goes @PLN! :wink:

Hey, I finally can confirm this works. Thanks for the help!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.