| #!/usr/bin/env groovy |
| |
| library 'functions' |
| |
| def packageBuildNames = [ |
| 'mendel-minimal', |
| 'base-files', |
| 'edgetpuvision', |
| 'edgetpudemo', |
| 'mdt-services', |
| 'mendel-distro-info-data', |
| 'mendel-keyring', |
| 'runonce', |
| 'usb-gadget', |
| 'vitalsd', |
| '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, privileged: true), |
| ], |
| envVars: [ |
| ], |
| ) { |
| |
| node(label) { |
| dir(workdir) { |
| stage('Init') { |
| container('debian') { |
| packageBuildNames.each { |
| copyArtifacts(projectName: it, filter: '**/*', flatten: true, selector: lastSuccessful()) |
| } |
| |
| sh """ |
| echo "deb http://packages.cloud.google.com/apt buster main" | sudo tee /etc/apt/sources.list.d/gcsfuse.list |
| curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - |
| apt-get update |
| apt-get -y install apt-utils gcsfuse |
| """ |
| } |
| } |
| |
| stage('Build') { |
| container('debian') { |
| sh """ |
| mkdir archive/pool |
| cp out/target/product/*/packages/*/* archive/pool |
| cd archive |
| 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 |
| } |
| } |
| } |
| } |
| } |