| #!/usr/bin/env groovy |
| |
| library 'functions' |
| |
| def packageBuildNames = [ |
| 'core.mendel-minimal', |
| 'core.base-files', |
| 'core.edgetpuvision', |
| 'core.edgetpudemo', |
| 'core.mdt-services', |
| 'core.mendel-distro-info-data', |
| 'core.mendel-keyring', |
| 'core.runonce', |
| 'core.usb-gadget', |
| 'core.vitalsd', |
| 'core.meta-mendel' |
| ] |
| |
| def label = "build-jenkins-operator-${UUID.randomUUID().toString()}" |
| def home = "/home/jenkins" |
| def workspace = "${home}/workspace/build-pbuilder-cross" |
| def workdir = "${workspace}/src" |
| |
| podTemplate(label: label, |
| containers: [ |
| containerTemplate(name: 'jnlp', image: 'jenkins/jnlp-slave:alpine'), |
| containerTemplate(name: 'debian', image: 'debian:buster-slim', command: 'cat', ttyEnabled: true), |
| ], |
| envVars: [ |
| ], |
| ) { |
| |
| node(label) { |
| dir(workdir) { |
| stage('Init') { |
| container('debian') { |
| sh """ |
| apt-get update |
| apt-get -y install apt-utils git |
| |
| git clone https://coral.googlesource.com/gke-jenkins gke-jenkins |
| cp gke-jenkins/apt-ftparchive/apt-ftparchive.conf . |
| cp gke-jenkins/apt-ftparchive/unstable.conf . |
| """ |
| } |
| } |
| |
| stage('Build') { |
| container('debian') { |
| packageBuildNames.each { |
| copyArtifacts(projectName: it, |
| filter: '**/*', |
| flatten: true, |
| target: 'mendel/pool/core', |
| selector: lastSuccessful()) |
| } |
| |
| dir('mendel') { |
| sh """ |
| mkdir -p dists/unstable/core/{source,binary-{all,arm64,armhf}} |
| find pool -name *.dsc >../sources.txt |
| find pool -name *.deb >../packages.txt |
| apt-ftparchive -c ../apt-ftparchive.conf \ |
| -o APT::FTPArchive::Release::Codename="unstable" \ |
| -o APT::FTPArchive::Release::Label="Coral Mendel Linux unstable release" \ |
| generate ../unstable.conf |
| """ |
| } |
| } |
| } |
| |
| stage('Deploy') { |
| container('debian') { |
| googleStorageUpload(bucket: 'gs://mendel-linux-apt/', |
| credentialsId: 'mendel-linux-cloud-infra', |
| pattern: 'mendel/**', |
| pathPrefix: 'mendel/', |
| sharedPublicly: true) |
| } |
| } |
| } |
| } |
| } |