Coder Social home page Coder Social logo

Multiple "Branded" Targets of same underlying App about fastlane HOT 19 CLOSED

ehlersd avatar ehlersd commented on December 6, 2016

My first solution was to setup a separate Fastfile for each branded target....but I'm not seeing a way to specify the Fastfile to use with fastlane.

I'll be integrating shortly with Jenkins (just trying to get a manual process working first).

So, what would be your recommendation as to the best way to setup and utilitize fastlane?

Thanks in advance...

from fastlane.

Comments (19)

joshdholtz avatar joshdholtz commented on March 4, 2015 2

Hey @ehlersd ,

I think I should be able to help you out here.

⚠️ Official Answer ⚠️

A PR of mine was just merged into master a few days ago (I don't think the gem has been pushed out yet) that allows for multiple environments using dotenv.

Ex: fastlane beta --env brand1 or fastlane beta --env brand2
Here is a gist with that example: - https://gist.github.com/joshdholtz/aa902e7ae28c1c0bea2a

⚠️ Unofficial Answer ⚠️

Since this isn't a "released" feature yet, you can use a gem I wrote that adds this ability AND "brand" specific lanes if you need that - https://github.com/joshdholtz/fastlane-env-lanes

If you use fastlane-env-lanes, you would call fastlane beta:brand1 instead of fastlane beta --env brand1. By using this gem, you can also decorate lanes for a specific brand.

require 'fastlane_env_lanes'

lane :beta do 
  # Only gets called if NO environment/brand is used
  puts "Why are you building without a brand?"
end

lane :beta, :brand1 do
  # Do some specific brand 1 stuff

  # Will load CONFIG and SCHEME from .env.<brand> where brand is brand1 because that is the environment specific lane we are in
    ipa({
        workspace: ENV['WORKSPACE'],
        configuration: ENV['CONFIG'],
        scheme: ENV['SCHEME'],
      })
end

lane :beta, :brand2 do
  # Do some specific brand 1 stuff

  # Will load CONFIG and SCHEME from .env.<brand> where brand is brand2 because that is the environment specific lane we are in
    ipa({
        workspace: ENV['WORKSPACE'],
        configuration: ENV['CONFIG'],
        scheme: ENV['SCHEME'],
      })

end

from fastlane.

ehlersd avatar ehlersd commented on March 4, 2015

Awesome! Great answer...thx!

from fastlane.

joshdholtz avatar joshdholtz commented on March 4, 2015

Note: The fastlane-env-lanes also loads the different .env files like my PR does. It just loads it differently :brand instead of --env brand.

Let me know if you need any more help with setting anything up! Always available to help 😁

from fastlane.

KrauseFx avatar KrauseFx commented on March 4, 2015

@joshdholtz being awesome again 🚀 😀 How about putting this information into its own .md file in the repository and link to it from the README?

from fastlane.

joshdholtz avatar joshdholtz commented on March 4, 2015

@KrauseFx I can do that! Let's keep this issue open until I do that

from fastlane.

KrauseFx avatar KrauseFx commented on March 9, 2015

@joshdholtz I'll assign the issue to you 😉

I'll be working on the big refactoring of the fastlane documentation, so let's wait until that's finished.

from fastlane.

fatuhoku avatar fatuhoku commented on March 10, 2015

Would love to try this. Wow. iOS tooling has just got even more awesome. 🍻

from fastlane.

KrauseFx avatar KrauseFx commented on May 21, 2015

@joshdholtz I got asked about the multiple targets again, if you have some time it would really be cool to add a short explanation to the docs folder when you have some time 👍

from fastlane.

jaroslavas avatar jaroslavas commented on June 15, 2015

I cannot make it load different snapshot config files. Am I doing something wrong?
.env.something:

LOCALIZED_CONFIGS_PATH="./fastlane/s_lt"

Fastfile (doesn't work):

lane :deploy do
  snapshot(
      snapshot_file_path: ENV["LOCALIZED_CONFIGS_PATH"],
    )
end

However, it works if I change it to:

lane :deploy do
  snapshot(
      snapshot_file_path: './fastlane/s_lt',
    )
end

Command: fastlane deploy --env something

It would also be very good if I could use ENV is Snapfile (and other config files) but it also doesn't seem to work.

from fastlane.

KrauseFx avatar KrauseFx commented on June 15, 2015

@jaroslavas Can you try replacing

LOCALIZED_CONFIGS_PATH="./fastlane/s_lt"

with

export LOCALIZED_CONFIGS_PATH="./fastlane/s_lt"

from fastlane.

jaroslavas avatar jaroslavas commented on June 15, 2015

Still getting Could not find './Snapfile'

from fastlane.

KrauseFx avatar KrauseFx commented on September 4, 2015

I'll close this issue for now, thanks @joshdholtz for providing the documentation on how to solve this problem 👍

from fastlane.

cytryn avatar cytryn commented on June 10, 2016

@joshdholtz and @KrauseFx , any news if fastlane-env-lanes is an official solution by now?

from fastlane.

joshdholtz avatar joshdholtz commented on June 10, 2016

@cytryn Oh man, I haven't update or ran the repo in a while 😇 I am not sure if it still works but definitely not an official solution 😉

Your best bet would probably be to have a separate .env file for each branch .env.brand1, .env.brand2, etc, and switch on stuff in your lane to a different method or something.

from fastlane.

cytryn avatar cytryn commented on June 10, 2016

@joshdholtz oh ok. I will definitely try that! Thanks for the update.

from fastlane.

joshdholtz avatar joshdholtz commented on June 10, 2016

@cytryn No problem! I should also go mark that repo has no longer supported probably 😬

from fastlane.

KrauseFx avatar KrauseFx commented on June 10, 2016

Correct me if I'm wrong, but dotEnv is already integrated into fastlane, run fastlane --help for more information

from fastlane.

joshdholtz avatar joshdholtz commented on June 10, 2016 1

@KrauseFx Yup yup, it is! But @cytryn was asking about my environment specific lanes repo (https://github.com/joshdholtz/fastlane-env-lanes) that I made back in the day. I mentioned that I don't support that and the official solution would be to use the .env.* method that is built in already 👌

from fastlane.

fbensaid avatar fbensaid commented on July 7, 2016

HI, is there any possible to use gym for a specific target ?

from fastlane.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.