Comments (19)
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.
@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.
Awesome! Great answer...thx!
from fastlane.
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.
@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.
@KrauseFx I can do that! β Let's keep this issue open until I do that
from fastlane.
@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.
Would love to try this. Wow. iOS tooling has just got even more awesome. π»
from fastlane.
@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.
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.
@jaroslavas Can you try replacing
LOCALIZED_CONFIGS_PATH="./fastlane/s_lt"
with
export LOCALIZED_CONFIGS_PATH="./fastlane/s_lt"
from fastlane.
Still getting Could not find './Snapfile'
from fastlane.
I'll close this issue for now, thanks @joshdholtz for providing the documentation on how to solve this problem π
from fastlane.
@joshdholtz and @KrauseFx , any news if fastlane-env-lanes is an official solution by now?
from fastlane.
@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.
@joshdholtz oh ok. I will definitely try that! Thanks for the update.
from fastlane.
@cytryn No problem! I should also go mark that repo has no longer supported probably π¬
from fastlane.
Correct me if I'm wrong, but dotEnv is already integrated into fastlane, run fastlane --help
for more information
from fastlane.
HI, is there any possible to use gym for a specific target ?
from fastlane.
Related Issues (20)
- Fastlane is not reading macros from Package.Swift (SPM)
- fastlane sigh download_all and "Error parsing provisioning profile at path..."
- fastlane match HOT 4
- bundler: command not found: fastlane
- Individual API Key not supported HOT 3
- fastlane deliver init is not working in CLI
- JEG2/highline should be updated to avoid warning of abbrev missing in standard lib for ruby 3.3.0
- How to get raw exit code from Fastlane HOT 1
- Match import to s3 Crash on encrypting. HOT 2
- Provisioning profile expiration comparison compares Time and DateTime
- AvailableTerritories is deprecated and fastlane is not upgraded to new api endpoints HOT 5
- Match managing provisioning profiles for DriverKit
- curb-1.0.0/lib/curl/easy.rb - Failed to read/open file
- `match` behaves differently in v2.220.0: `wrong final block length` HOT 12
- Can't upload build to Test Flight; [!] undefined method `refresh!' HOT 2
- A parameter has an invalid value - 'prices' is not a valid relationship name HOT 8
- I run the command 'fastlane match development'. and i got the following error: Looking for related GitHub issues on fastlane/fastlane... Found no similar issues. To create a new issue, please visit: https://github.com/fastlane/fastlane/issues/new Run fastlane env to append the fastlane environment to your issue [!] The request could not be completed because: This request is forbidden for security reasons - You currently don't have access to this membership resource. Contact your team's Account Holder, or an Admin.
- Build_for_testing fails sporadically with error 'Could not find or use auto-linked framework' HOT 2
- Can fastlane support filling in Chinaβs ICP registration number?
- [match] provisioning profile generated via match blocks release installation on TestFlight (or on device)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastlane.