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

feat(actions) Add additional encrypt/decrypt actions. Allow session create to use different users. #23

Merged
merged 9 commits into from
Feb 12, 2020

Conversation

cball
Copy link
Member

@cball cball commented Feb 11, 2020

This PR is tackling two very important issues.

  1. A complex config for the consuming app's Fastlane setup
  2. A way to authorize a session and then later login with different accounts.

Changes

  • Simplify create_fastlane_session. It now re-uses some ENV vars, and prompts for the user to release as.
  • Add add_app_var action to add a single env var
  • Add decrypt_android_keystore and generate_android_keystore to make working with keystores easier
  • Add encrypt_app_vars and decrypt_app_vars to handle writing / restoring ENV. decrypt_app_vars takes an optional namespace which allows us to override for alpha, beta, or release
  • Add encrypt_google_play_credentials and decrypt_google_play_credentials to handle writing/restoring the Google Play JSON

This PR is tackling two very important issues.
1) A complex config for the consuming app's Fastlane setup
2) A way to authorize a session and then later login with different accounts.
@code-jenn-or
Copy link
Contributor

code-jenn-or commented Feb 11, 2020

Can we please update the readme to include which .env files should have which variables?
i.e. ROOT/.env : app specific variables like API url, etc
ROOT/ios/fastlane/.env : list of vars that should be in this one
ROOT/android/fastlane/.env ....
ROOT/fastlane/.env

tag_prefix = 'releases'
base_branch = params[:beta_branch]
target_branch = params[:production_branch]
# TODO: ohter branches

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohter

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will address in #24

sh "git show-ref #{target_branch}" do |status|
sh "git branch -D #{target_branch}" if status.success?
end
# if !is_hotfix

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: hotfix

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol didnt mean to do markdown here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added as #24

Copy link

@ryanpatk ryanpatk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me. Maybe some additional comments in the
TODO: flows section to help jog anyone's memory when they come back there

nice work!


def self.authors
# So no one will ever forget your contribution to fastlane :) You are awesome btw!
["cball", "isaiahgrey93"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look forward to increasing this array size 😄

is_beta = target.include?('beta')
is_hotfix = params[:hotfix] === true
release_type = params[:release_type] || UI.select("Select a release type:", VALID_RELEASE_TYPES)
is_beta = release_type.include?('beta')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not important at all, but these three lines (and the following conditional) could be done metaprogram-y to set the state for more release types in the future.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

totally agree. I want to rework this whole action in a followup PR to properly support master-based and gitflow-based workflows (and hotfixes). I'll try and clean up there as well.

Copy link

@mcavaliere mcavaliere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My Fastlane skill is wayyyy out of date, but FWIW looks amazing. Two small unimportant comments.

@cball cball merged commit 35694d0 into master Feb 12, 2020
@cball cball deleted the cb-more-actions branch February 12, 2020 16:01
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

Successfully merging this pull request may close these issues.

4 participants