Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to deploy to Heroku with 2-factor? #242

Open
hintoz opened this issue Mar 6, 2019 · 6 comments
Open

How to deploy to Heroku with 2-factor? #242

hintoz opened this issue Mar 6, 2019 · 6 comments

Comments

@hintoz
Copy link

hintoz commented Mar 6, 2019

At the moment, is there a way to install a new app with two-factor authentication on Heroku?
All the above methods do not work now.

@FinHorsley
Copy link
Contributor

Are you talking about 2FA on your Apple account connected to AppStore Connect?

@joshdholtz
Copy link
Member

@hintoz If you could provide a little more detail on what you are trying to accomplish that would be great! iOS and Android apps (which fastlane supports) are not deloyable on Heroku so we might need some clarification on what you are trying to accomplish 🙃

Sent with GitHawk

@hintoz
Copy link
Author

hintoz commented Mar 9, 2019

Are you talking about 2FA on your Apple account connected to AppStore Connect?

Yes.

@hintoz
Copy link
Author

hintoz commented Mar 9, 2019

@hintoz If you could provide a little more detail on what you are trying to accomplish that would be great! iOS and Android apps (which fastlane supports) are not deloyable on Heroku so we might need some clarification on what you are trying to accomplish 🙃

Sent with GitHawk

Since the question is in the repository boarding, then the question is about it.

I solved the problem of deploying the new boarding on Heroku as follows:
Create an empty application on Heroku.
Then in terminal:
heroku git:clone --app [heroku_app_name] (it will be an empty repo)
cd [heroku_app_name]
Create a Gemfile with the contents:

source 'https://rubygems.org'
gem 'fastlane'

Run bundle install, then git push
Now we have fastlane deployed to heroku and we can receive heroku run fastlane spaceauth authorization sessions. Configure all env on heroku.
Previously, you could just put fastlane on heroku, via heroku run gem install fastlane.

Now we need boarding.
delete gemfile and gemfile.lock (do not forget the committing all of his actions) and execute

git pull https://github.com/fastlane/boarding
git push

@coderbec
Copy link
Contributor

Hi, I have made an amendment to this that adds the FASTLANE_SESSION variable to the app.json. This is a preferable solution because it allows users to use the "deploy to heroku" button and have it work out of the box, rather than the solution above. I will submit this as a PR.

@lukestringer90
Copy link

I followed @hintoz's steps above and managed to get Boarding deployed to Heroku with a session generated using spaceauth to get around 2FA problems. Here's what I did.

Clone locally.

git clone https://github.com/fastlane/boarding.git

Edit the Gemfile to just include fastlane (comment out or remove the other boarding-specific gems)

# ruby '2.3.3'
gem 'fastlane', '>= 2.126.0', '< 3.0.0'

Commit and push to your Heroku app. (Make sure app should has a blank repo.)

Then run heroku run fastlane spaceauth and sign in to App Store Connect through the terminal, inputting your 2FA code when prompted. This will create a session on the Heroku server. Note - you must do this on the server. In my experience if you run this locally the session cannot be transferred to the server.

Copy the FASTLANE_SESSION from the terminal output into Heroku as a config (env) var. This will allow Heroku to use the App Store connect session for around a month.

Make sure all these vars are set in Heroku:

  • FASTLANE_SESSION
  • ITC_APP_ID
  • ITC_APP_TESTER_GROUPS
  • ITC_PASSWORD
  • ITC_USER

Now edit the Gemfile to mirror that off the original boarding repo (reverting the previous commit is the easier way.) Commit and push back Heroku. Boarding will now deploy and connect to App Store Connect using your session information and username and password.

Hope this helps someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants