| #!/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 |
| """ |
| } |
| } |
| |
| stage('Build') { |
| container('debian') { |
| sh "install -d archive/pool -m 777" |
| |
| packageBuildNames.each { |
| copyArtifacts(projectName: it, |
| filter: '**/*', |
| flatten: true, |
| target: 'archive/pool', |
| selector: lastSuccessful()) |
| } |
| |
| dir('archive/pool') { |
| sh "apt-ftparchive -o APT::FTPArchive::SHA512=false pool > Packages" |
| } |
| } |
| } |
| |
| stage('Deploy') { |
| container('debian') { |
| googleStorageUpload(bucket: 'gs://mendel-linux-apt/', |
| credentialsId: 'mendel-linux-cloud-infra', |
| pattern: 'archive/**', |
| pathPrefix: 'archive/', |
| sharedPublicly: true) |
| } |
| } |
| } |
| } |
| } |