blob: 172f2c60a8786e3c9ab470af5a3b35902514a9fa [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-armhf"
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 python3 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: 6, 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
export USERSPACE_ARCH=armhf
m prereqs \$ROOTDIR/cache/armhf-base.tgz
exit \$?'
"""
}
}
stage('Deploy') {
archiveArtifacts artifacts: "cache/armhf-base.tgz", fingerprint: true
}
}
}
}