Giter Site home page Giter Site logo

fastlane-example's Introduction

Description

This is an example of using fastlane with Jenkins 2 and it's pipeline-as-code plugin.

The pipeline as 4 stages, each defined as it's own lane in fastlane and is designed to deploy test apps to HockeyApp.

More information on what each stage does can be found in the Readme.md under the fastlane directory.

Usage

Put the fastlane and pipeline folders in this repo into your project root directory. Move your xcodeproj, xcworkspace and code directories into a subdirectory called src. The directory strucure should look like this:

<project-root>/
├── fastlane/
│   ├── Fastfile
│   ├── .env.default
│   ├── .env.production
│   ├── .swiftlint.yml
│   └── Readme.md
├── pipelines/
│   └── Jenkinsfile
└── src/
    ├── *.xcodeproj
    ├── *.xcworkspace
    ├── SomeFolderWithCode/
    └── SomeFolderWithTests/

Set your project params in .env.default. Further docs on how this is leveraged is found in the readme in the fastlane directory.

Set up your build server using the setup-ios-build-server.sh script.

Set up Jenkins as per your requirements. There are a variety of guides available on the internet. This is the one I used. I also set up Nginx as a reverse proxy to make Jenkins accessible on port 80.

Follow the Jenkins 2 pipeline-as-code plugin docs and point it to the Jenkinsfile under the pipelines directory.

SwiftLint

The lint lane does produce a SwiftLint report but it's in plain text and not very readable. Other formats produced by SwiftLint are meant to be machine readable by tools such as Sonar which are complete rubbish and a pain to set up.

Hence, It's better to integrate SwiftLint with Xcode so it's easier to track issues. Create a "Run Script" build phase in your Xcode project and copy the following in:

if which swiftlint >/dev/null; then
    cd ..
    cp fastlane/.swiftlint.yml src/.swiftlint.yml

    swiftlint
else
    echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi

License

This project is available under the MIT license. See the LICENSE.md file for more info.

Feedback and Questions

Email me if you run into any trouble or have any feedback!

[email protected]

fastlane-example's People

Watchers

 avatar  avatar

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.