blob: f4633108c1682a0d25c8226a207f9702f602a636 [file] [log] [blame]
#!/usr/bin/env groovy
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') {
sh """
apt-get update
apt-get -y install build-essential python curl git qemu-user-static sudo
curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/local/bin/repo
chmod a+x /usr/local/bin/repo
mkdir -p ${workdir}/.repo/local_manifests
"""
timeout(time: 3, unit: 'MINUTES') {
checkout([$class: 'RepoScm',
currentBranch: true,
jobs: 24,
manifestRepositoryUrl: 'http://coral.googlesource.com/manifest',
manifestBranch: 'master',
manifestFile: 'enterprise.xml',
depth: 1,
quiet: true])
}
}
}
stage('Build') {
container('debian') {
sh """
bash -c 'source build/setup.sh; m prereqs \$ROOTDIR/cache/cross-base.tgz; exit \$?'
"""
}
}
stage('Deploy') {
archiveArtifacts artifacts: "cache/cross-base.tgz", fingerprint: true
}
}
}
}