Skip to content

Instantly share code, notes, and snippets.

@jaleksynas
Created March 1, 2019 17:48
Show Gist options
  • Save jaleksynas/5ba41c297c3b23c26d6a90c99c03435d to your computer and use it in GitHub Desktop.
Save jaleksynas/5ba41c297c3b23c26d6a90c99c03435d to your computer and use it in GitHub Desktop.
Using Helper.is_ci?
# Example of only doing something in or out of ci.
#=> fastlane my_process
#=> JENKINS_URL=foo fastlane my_process
before_all do
ci_stuff
end
lane :my_process do
UI.message "Only do this when in CI" if Helper.is_ci?
UI.message "Only do this when out of CI" unless Helper.is_ci?
end
def ci_stuff
return unless Helper.is_ci?
UI.message "Doing CI setup actions"
# For Example...
# unlock_keychain
# cocoapods
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment