Giter Site home page Giter Site logo

fivethree-team / ionic-fastlane-plugin Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 4.0 3.11 MB

🧩 fastlane plugin for Ionic 4+

Home Page: https://rubygems.org/gems/fastlane-plugin-fivethree_ionic

License: MIT License

JavaScript 1.88% TypeScript 10.86% HTML 6.65% CSS 3.16% Ruby 77.46%
fastlane fastlane-plugin fastlane-ionic ci cd fastlane-cordova ionic

ionic-fastlane-plugin's Introduction

Ionic Fastlane Plugin

ionic-fastlane-plugin

fastlane plugin for Ionic 4+.

Table of content

Getting started

Install the ionic-fastlane plugin

fastlane add_plugin fastlane-plugin-fivethree_ionic

This will add gem 'fastlane-plugin-fivethree_ionic' in the fastlane/Pluginfile.

Actions

This Fastfile contains example of the following actions.

Action Description
fiv_add_transparent_statusbar
fiv_build_ionic_android
fiv_android_keystore Generate an Android keystore file or validate keystore exists
fiv_build_ionic_android
fiv_bump_version
fiv_clean_install
fiv_increment_build_no
fiv_ionic Build your Ionic app for a specific platform
fiv_select_client Select a client for white labeling the app
fiv_select_clients Select all, many or one client for white labeling the app
fiv_select_env Select an environment folder for white labeling the app
fiv_sign_android Zipalign, sign and verify apk
fiv_update_version
fiv_update_version_and_build_no
fiv_version

fiv_add_transparent_statusbar

fiv_android_keystore

Generate an Android keystore file or validate keystore exists

Options

Options Description Type Default Required
keystore_path Path to the android string ./fastlane/android false
keystore_name Name of the keystore string true
key_alias Key alias of the keystore string true

fiv_build_ionic_android

fiv_bump_version

fiv_clean_install

fiv_increment_build_no

fiv_ionic

Build your Ionic app for iOS:

outputpath =
  fiv_ionic(
    platform: 'ios', release: 'true', prod: 'true', team_id: 'YOUR_TEAM_ID'
  )

Build your Ionic app for Android:

outputpath = fiv_ionic(platform: 'android', release: 'true', prod: 'true')

Options

Options Description Type Default
platform Platform to build on. Can be android, ios or browser android | browser | ios
prod Build for production true | false false
release Build for release if true, or for debug if false true | false true
team_id The development team (Team ID) to use for code signing string
type This will determine what type of build is generated by Xcode. Valid options are development, enterprise, adhoc, and appstore development | enterprise | adhoc | appstore appstore

fiv_select_client

Add fiv_select_client to your lane to select a client for copying client specific resources before your app build.

For example you have the following app clients:

  • clients
    • companyA
      • resources
      • ...
    • companyB
    • companyZ

fiv_select_client() lets you select one client and returns the client name.

client = fiv_select_client

# copy client resources e.g. "cp ../clients/#{client}/resources ../"
# build app

CI

Client selection can also be passed as an option for a non interactive environment. Add the option client to before_all and assign it to an environment variable CLIENT.

before_all { |lane, options| ENV['CLIENT'] = options[:client] }

fastlane example_lane client:companyA

Options

Options Description Type Default Required
clients_folder Path to your clients white label resources string clients false

fiv_select_clients

Add fiv_select_clients to your lane to select all, many or one client for copying client specific resources before your app build in a loop.

For example you have the following app clients:

  • clients
    • companyA
      • resources
      • ...
    • companyB
    • companyZ

fiv_select_clients() lets you select all, many or one client and returns an array of client names.

clients = fiv_select_clients

clients.each { |client| }

CI

Clients selection can also be passed as an option for a non interactive environment. Add the option clients to before_all and assign it to an environment variable CLIENTS.

before_all { |lane, options| ENV['CLIENTS'] = options[:clients] }

Seperate clients by ,:

fastlane example_lane clients:companyA,companyB

Options

Options Description Type Default Required
clients_folder Path to your clients white label resources string clients false

fiv_select_env

Add fiv_select_env to your lane to select an environment of a client for copying specific resources for this environment before your app build. e.g the resources or app icon and splash screen might differ for each environment.

For example you have the following app clients with different environments:

  • clients
    • companyA
      • resources
      • environment
        • prod
          • resources
        • qa
          • resources
        • test
          • resorces
    • companyB
    • companyZ

fiv_select_env() lets you select one client and returns the client name.

client = fiv_select_client
env = fiv_select_env(client: client)

# copy client resources from environment e.g. "cp ../clients/#{client}/enviroment/#{env}/resources ../"
# build app

CI

Environment selection can also be passed as an option for a non interactive environment. Add the option env to before_all and assign it to an environment variable ENV.

before_all do |lane, options|
  ENV['CLIENT'] = options[:client]
  ENV['ENV'] = options[:env]
end

fastlane example_lane client:companyA env:prod

Options

Options Description Type Default Required
clients_folder Path to your clients white label resources string clients false
environments_folder Path to your environments white label resources string environments false
client Path to your selected client string true

fiv_sign_android

Zipaligns, signs v2 and verifys an apk with a keystore. If the keystore does not exists it uses fiv_android_keystore to create a new keystore.

# run before signing: ionic cordova build android --prod --release

apk_path =
  fiv_sign_android(
    keystore_name: 'pizza',
    key_alias: 'pizza',
    app_version: '1.0.1',
    app_build_no: '2020',
    apk_output_dir: './apk',
    silent: true
  )

Options

Options Description Type Default Required
keystore_path Path to the android string ./fastlane/android false
keystore_name Name of the keystore used to store storepass and keypass in keychain string true
android_sdk_path Path to your installed Android SDK string ~/Library/Android/sdk false
android_build_tool_version Android Build Tool version used for zipalign, sign and verify string 28.0.3 false
apk_source Android Build Tool version used for zipalign, sign and verify string ./platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk false
apk_zipalign_target Target path for the zipaligned apk string ./platforms/android/app/build/outputs/apk/release/app-release-unsigned-zipalign.apk false
apk_signed_target Target path of the signed apk string ./platforms/android/app/build/outputs/apk/release false
key_alias Key alias of the keystore string true
app_version App version string true
app_build_no App build number string true

fiv_update_version

fiv_update_version_and_build_no

fiv_version

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.