Coder Social home page Coder Social logo

jenkins-pipeline-steps's Introduction

A collection of build steps for use with Jenkins pipelines packaged as a shared library.

Usage

Fetch and load the library following the guidelines from the Jenkins documentation.

Available Steps

Android

installAndroidSdkPackages

Build step which automates installation of Android SDK components either through explicit declaration or by scanning the workspace for Gradle and Xamarin projects to extract the required SDK components from project files.

The following components will be installed and configured automatically:

  • platform-tools
  • tools
  • emulator
  • extras;android;m2repository
  • extras;google;m2repository
  • extras;intel;Hardware_Accelerated_Execution_Manager

To scan the job workspace for Gradle and Xamarin projects, simply call the step as follows:

node {
    installAndroidSdkPackages()
}

To install packages explicitly, just pass a list of the packages to the installAndroidSdkPackages like below. Note that package names should match the Android sdkmanager format.

node {
    installAndroidSdkPackages([
        "build-tools;27",
        "platform-27"
    ])
}

withAvd

Build step for launching Android AVDs - an AVD will be created with a unique name for the build currently being executed, launched then destroyed when the nested steps have completed. The step takes a map of arguments with the following keys:

  • hardwareProfile - the ID of an Android SDK hardware profile. Only the default SDK provided hardware profiles are supported which can be found by running avdmanager list.
  • systemImage - the system image to be used for the AVD, this should be in the sdkmanager format e.g. system-images;android-27;default;x86. The system image will be automatically installed if not already available.
  • (Optional) headless - a boolean signifying whether or not the the AVD should run with -no-window launch option included. Defaults to true if not specified.
  • A closure containing the build steps to execute while the AVD is running.
node {
    withAvd(hardwareProfile: "Nexus 5X", systemImage: "system-images;android-27;default;x86", headless: false) {
        sh "./gradlew connectedAndroidTest"
    }
}

Note that this build step will automatically set the ANDROID_SERIAL environment variable so that the Gradle connectedAndroidTest tasks knows which emulator to target if multiple AVDs have been launched or concurrent builds are in progress for a build node.

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.