| #!/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 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 |
| } |
| } |
| } |
| } |