NoPaste

Jenkinsfile: build lineageos 15.1

von TRex

Dein Code:
  1. node("android") {
  2.    
  3.     def ctree = "/srv/android/15.1/system"
  4.     def device_path ="${ctree}/vendor/lge"
  5.     def blob_tree = "${ctree}/device/lge/hammerhead"
  6.     def CM_VER="15.1"
  7.     def device_codename = "hammerhead"
  8.    
  9.     stage("prepare") {
  10.         sh 'java -version'
  11.         sh 'df -h'
  12.         sh "ln -s /srv/android/15.1 android"
  13.         sh "adb -a -P 5037 server"
  14.     }
  15.    
  16.     stage("repository update") {
  17.  
  18.         sh "mkdir -p ${ctree}"
  19.         dir(ctree) {
  20.             sh "repo init -u https://github.com/LineageOS/android.git -b lineage-${CM_VER}"
  21.             sh "repo sync -q"
  22.             sh 'prebuilts/misc/linux-x86/ccache/ccache -M 100G'
  23.         }
  24.     }
  25.     stage("get prebuilt apps") {
  26.         if(false) {
  27.             dir("${ctree}/vendor/cm") {
  28.                 sh './get-prebuilts'
  29.             }
  30.         }
  31.     }
  32.     stage("prepare device code") {
  33.         dir(ctree) {
  34.             sh "#!/bin/bash \n" +
  35.             ". build/envsetup.sh &&. build/envsetup.sh && breakfast ${device_codename}; env"
  36.         }
  37.     }
  38.    
  39.     // possibly this fails, then breakfast needs repetition afterwards
  40.     stage("extract proprietary blobs") {
  41.         dir(blob_tree) {
  42.             sh 'test -f ./extract-files.sh && ./extract-files.sh || true'
  43.         }
  44.     }
  45.     stage("build") {
  46.         dir(ctree) {
  47.             sh "#!/bin/bash \n" +
  48.             ". build/envsetup.sh && brunch ${device_codename}"
  49.         }
  50.         def glob = "**/out/target/product/${device_codename}/lineage-${CM_VER}*-${device_codename}.zip"
  51.         archiveArtifacts glob
  52.     }
  53.     stage("deploy") {
  54.          
  55.         sh "adb devices"
  56.     }
  57.    
  58. }

Quellcode

Hier kannst du den Code kopieren und ihn in deinen bevorzugten Editor einfügen. Alternativ kannst du den gesamten Eintrag auch als Datei herunterladen.