import_from_git
Import another Fastfile from a remote git repository to use its lanes
This is useful if you have shared lanes across multiple apps and you want to store the Fastfile in a remote git repository.
| import_from_git | |
|---|---|
| Supported platforms | ios, android, mac |
| Author | @fabiomassimo, @KrauseFx, @Liquidsoul |
2 Examples
import_from_git(
url: "git@github.com:fastlane/fastlane.git", # The URL of the repository to import the Fastfile from.
branch: "HEAD", # The branch to checkout on the repository.
path: "fastlane/Fastfile", # The path of the Fastfile in the repository.
version: "~> 1.0.0" # The version to checkout on the repository. Optimistic match operator can be used to select the latest version within constraints.
)
import_from_git(
url: "git@github.com:fastlane/fastlane.git", # The URL of the repository to import the Fastfile from.
branch: "HEAD", # The branch to checkout on the repository.
path: "fastlane/Fastfile", # The path of the Fastfile in the repository.
version: [">= 1.1.0", "< 2.0.0"], # The version to checkout on the repository. Multiple conditions can be used to select the latest version within constraints.
cache_path: "~/.cache/fastlane/imported" # A directory in which the repository will be added, which means that it will not be cloned again on subsequent calls.
)
Parameters
| Key | Description | Default |
|---|---|---|
url |
The URL of the repository to import the Fastfile from | |
branch |
The branch or tag to check-out on the repository | HEAD |
dependencies |
The array of additional Fastfiles in the repository | [] |
path |
The path of the Fastfile in the repository | fastlane/Fastfile |
version |
The version to checkout on the repository. Optimistic match operator or multiple conditions can be used to select the latest version within constraints | |
cache_path |
The path to a directory where the repository should be cloned into. Defaults to nil, which causes the repository to be cloned on every call, to a temporary directory |
* = default value is dependent on the user's system
Documentation
To show the documentation in your terminal, run
fastlane action import_from_git
CLI
It is recommended to add the above action into your Fastfile, however sometimes you might want to run one-offs. To do so, you can run the following command from your terminal
fastlane run import_from_git
To pass parameters, make use of the : symbol, for example
fastlane run import_from_git parameter1:"value1" parameter2:"value2"
It's important to note that the CLI supports primitive types like integers, floats, booleans, and strings. Arrays can be passed as a comma delimited string (e.g. param:"1,2,3"). Hashes are not currently supported.
It is recommended to add all fastlane actions you use to your Fastfile.
Source code
This action, just like the rest of fastlane, is fully open source, view the source code on GitHub