Giter Club home page Giter Club logo

fastlane-env-lanes's Introduction

fastlane-env-lanes

Fastlane environment specific lanes (implemented a bit hacky)

Functionality

  • Loads .env and .env.default with dotenv
  • Loads .env.<environment> for environment passed in through fastlane test:<environment>
    • Ex: fastlane test:production
  • Define lanes for specific environments

Requirements

  • 'fastlane', '~> 0.1.7'
  • 'dotenv', '~> 0.7'

Installation

Gemfile

source 'https://rubygems.org'
ruby "2.0.0"

gem 'fastlane'
gem 'fastlane_env_lanes', '~> 0.2'

Custom Action

A custom action is needed to preload this library properly. Create an action file called envlanes.rb in the fastlane/actions directory and use the following code below.

require 'bundler/setup' # Might need to do this or might not need to do this
require 'fastlane_env_lanes' # <---- THE IMPORTANT STUFF

module Fastlane
  module Actions

    class EnvlanesAction < Action
      def self.run(params)
        Helper.log.info "This should never get run!"
      end
    end
  end
end

Example

before_all do |lane|
  # Do some before stuff here
end

lane :test do 
  # snapshot
  puts "test NOT in production"
end

lane :test, :production do
  puts "test in production"
end

# Execute by `fastlane beta --env development`
# OR
# Execute by `fastlane beta --env staging`
# OR
# Execute by `fastlane beta`
lane :beta do
  # Do HockeyApp stuff here
end

# Execute by `fastlane beta --env production`
lane :beta, :production do
  # Do Apple TestFlight Beta stuff here
end

Usage

--- iOS/YourApp » fastlane test:production
INFO [2015-02-16 15:17:40.68]: Loading from './fastlane/.env.production'
INFO [2015-02-16 15:17:40.68]: Driving the lane 'test__production'
test in production
INFO [2015-02-16 15:17:40.69]: fastlane.tools finished successfully
--- iOS/YourApp » fastlane test        
INFO [2015-02-16 15:19:19.94]: Driving the lane 'test'
test NOT in production
INFO [2015-02-16 15:19:19.94]: fastlane.tools finished successfully 🎉

fastlane-env-lanes's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fastlane-env-lanes's Issues

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.