Git Product home page Git Product logo

jenkins-aosp-project's Introduction

Jenkins Pipeline for AOSP

Powered By Jenkins

"This repository is a Jenkins shared library"

Requirements

System Packages

The following packages must be installed on the system on which the pipepline will run (the Jenkins master or any slave):

  • bash
  • git
  • nohup
  • repo

Jenkins Plugins

This is the list of plugin's shortnames:

How to use it ?

Importing and using this pipeline (or shared library) can be performed from a script which will be interpreted by Jenkins. That script can be written in two ways:

It is generally considered a best practice to create a Jenkinsfile and check the file into the source control repository.

Import the shared library

To import this shared library, write the following piece of code at the beginning of the script (or before using the pipeline):

library identifier: '@test', retriever: modernSCM([
    $class: 'GitSCMSource',
    credentialsId: '<private-key-id>',
    remote: 'https://git.smile.fr/ecs-ci/jenkins-pipeline-aosp.git',
])

The credentialsId parameter is an ID which refers to one of your credentials in Jenkins whose users need permissions to use it (see the credential table in the web UI: Jenkins > Credentials).

Use the pipeline

Add the following code to the script and complete it:

env = [
    "NODE_LABEL=<node-label>"
]

withEnv(env) {
    aospPipeline {
        doClean         = true
        manifestUrl     = "<[email protected]:user/repository>"
        repoBranch      = "<repo-branch-name>"
        targetProduct   = "<target-name>" // ex: "aosp_x86_64"
        buildVariant    = "eng"           // ex: "user" or "userdebug"
        ccacheEnabled   = true
        ccacheSize      = "50G"
        jobCpus         = 4
    }
}

The withEnv expression injects the env Map's variables into the Jenkins environment which enables the pipeline to read them. The pipeline requires the NODE_LABEL environment variable which will instruct Jenkins to execute the pipeline on a specific agent/node.

See also

For more details about arguments and options, look at the:

Advanced

Pipeline's stages

  1. Preparation (pre-pipeline);
  2. SCM - downloading the sources with repo;
  3. Build - building the AOSP;
  4. Static Analysis - only on the building's output not the sources;
  5. Unit Tests - using the Android CTS;
  6. SonarQube - send static analysis, unit testing and coverage results;
  7. Post (post-pipeline).

Debugging

  • Skip some stages as you please, using the skipStages option (ex: skip "SCM" and "Build" stages):
aospPipeline {
...
    skipStages = [
        scm   : true,
        build : true
    ]
}

jenkins-aosp-project's People

Contributors

ventto 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.