betalane
v3.0.3
Published
`betalane` is super easy to use beta distribution tool for iOS
Maintainers
Readme
Highly inspired by Fastlane.tools the greatest Automation tool ever for your beta deployments of iOS/Android Builds, but betalane is purely made in Javascript and it's super easy to use!
Version: 3.0.1
Features
build- Building your appdoa_s3- Distribute on the Air using AWS S3cli- Execute any cli commanddownload_file- Download a file from a URL
Getting Started
Make sure you have the latest version of the Xcode command line tools installed:
xcode-select --installInstallation
[sudo] npm i betalane -gSetup
- Create
betalane.jsonon the root of your project.
.
├── Example
├── Example.xcodeproj
└── betalane.json- Confgiure
laneandjobsinbetalane.jsonfile as shown in the following example
[
{
"laneName": "beta",
"jobs": [
{
"job": "cli",
"options": {
"cmd": "cd Example && carthage update --platform iOS"
}
},
{
"job": "build",
"options": {
"scheme": "Example-Dev",
"provisioningProfile": "e9890938-67cd-4e01-a197-7a43c2e355a4"
}
}
]
}
]Project Structure
betalane.json: This file defines yourlanesandjobs. It's the core configuration forbetalane.lib/laneDriver.js: This is the main entry point forbetalanethat orchestrates the execution oflanesandjobsdefined inbetalane.json.
- Add
.betalaneto your.gitignorefile
# Betalane processing directory
.betalaneIn action...
From the root of your project execute the following command
$ betalane [lane] [job]Example 1 - excute all lanes and all jobs
$ betalaneExample 2 - excute specific lane and all it's jobs
$ betalane betaExample 3 - excute specific lane and specific job
$ betalane beta buildDocumentation
build - Building your app
{
"job": "build",
"options": {
"scheme": "Example-Dev",
"target": "Example",
"buildConfiguration": "Debug",
"method": "development",
"signingCertificate": "iOS Developer",
"compileBitcode": "NO",
"provisioningProfile": "e9890938-67cd-4e01-a197-7a43c2e355a4"
}
}options : {
property | Optional | Description | Default | Available Options
--- | --- | --- | --- | ---
scheme | (Optional) | Scheme | <Project Name>
target | (Optional) | Target | <Project Name>
buildConfiguration | (Optional) | Build Configuration | Debug
compileBitcode | (Optional) | Should complie BitCode? | NO | YES, NO
method | (Optional) | Distribution Method | development | app-store, ad-hoc, development
signingCertificate | (Optional) | Certificate | Auto Selected from Build Setting
provisioningProfile | (Optional) | Provisioning Profile | Auto Selected from Build Settings | Profile ID, Profile Name
}
Output Params
Params | Description | Sample Value
--- | --- | ---
BL_BUILD_ARCHIVE_PATH | Archive path | /Users/jay.mehta/Example/.betalane/Example.xcarchive
BL_BUILD_IPA_PATH | IPA File path | /Users/jay.mehta/Example/.betalane/Example-Dev.ipa
doa_s3 - Distribute on the Air using AWS S3
This job uploads your IPA to an S3 bucket and generates an installable HTML page that supports both iPhone and iPad devices.
{
"job": "doa_s3",
"options": {
"AccessKeyID": "AKXXXXXXXXXEXAMPLE",
"SecretAccessKey": "wJXXXXXXXXXX/K7XXXXXX/XXXXXXXEXAMPLEKEY",
"s3Bucket": "example-beta-builds",
"region": "us-east-2",
"prefix": "builds/ios/",
"buildPath" : "env.BL_BUILD_IPA_PATH"
}
}options : {
property | Optional | Description | Default | Available Options
--- | --- | --- | --- | ---
AccessKeyID | Required | AccessKeyID - Obtain from IAM
SecretAccessKey | Required | SecretAccessKey - Obtain from IAM
s3Bucket | Required | AWS S3 Bucket Name
region | Required | AWS S3 Bucket Region
prefix | (Optional) | S3 Key Prefix | betalane/
buildPath | (Optional) | Build Path to upload on S3 | env.BL_BUILD_IPA_PATH - Env variable exposed by build job
}
Output Params
Params | Description | Sample Value
--- | --- | ---
BL_DOA_S3_BUILD_URL | Build Url | https://example-beta-builds.s3.amazonaws.com/doa-beta-20-Aug-2018-14-40-58/package.ipa
BL_DOA_S3_MANIFEST_URL | Menifest Url | https://example-beta-builds.s3.amazonaws.com/doa-beta-20-Aug-2018-14-40-58/manifest.plist
BL_DOA_S3_INSTALL_URL | Installable Url | https://example-beta-builds.s3.amazonaws.com/doa-beta-20-Aug-2018-14-40-58/download.html
IAM Policy Sample
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "StmtBetalaneS3Policy",
"Action": [
"s3:PutObject",
"s3:PutObjectAcl"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::example-beta-builds/*"
}
]
}Steps to create S3 bucket
- Login to AWS Console
- Click on S3 service
- Create Bucket
- Enter "Bucket Name", Click "Next", "Next", "Next", "Cerate Bucket".
Steps to create IAM User
- Login to AWS Console
- Click on IAM service
- Select Policies from left side menu
- Select "Create Policy"
- Click on "JSON" tab
- Replace JSON with above sample and change bucket name in
Resourcekey - Click "Review Policy"
- Name your policy, e.g. Example Beta Lane S3 Policy
- Click "Create Policy"
- Now select "Users" from left side menu
- Click "Add User"
- Give some "Username", and select "Programmatic access" from Access Type.
- Select "Attach Existing Policy"
- Look for the policy you just created and select it, Click "Next: Review"
- Review and Click "Create"
- Download CSV file containing your
AccessKeyIDandSecretAccessKey
cli - Execute any cli command
{
"job": "cli",
"options": {
"cmd": "cd Example && carthage update --platform iOS"
}
}options : {
property | Optional | Description | Default | Available Options
--- | --- | --- | --- | ---
cmd | Required | Command to be performed
}
download_file - Download a file from a URL
{
"job": "download_file",
"options": {
"url": "https://example.com/somefile.zip",
"filename": "my_download",
"ext": "zip"
}
}options : {
property | Optional | Description | Default | Available Options
--- | --- | --- | --- | ---
url | Required | The URL of the file to download
filename | (Optional) | The desired filename for the downloaded file | A UUID
ext | (Optional) | The file extension for the downloaded file | unknown
}
Output Params
Params | Description | Sample Value
--- | --- | ---
BL_DOWNLOADED_FILE | Path to the downloaded file | /Users/jay.mehta/Example/.betalane/my_download.zip
