| #!/usr/bin/env groovy | |
| def label = "build-jenkins-operator-${UUID.randomUUID().toString()}" | |
| def home = "/home/jenkins" | |
| def workspace = "${home}/agent/workspace/build-pbuilder-arm64" | |
| 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=arm64 | |
| m prereqs \$ROOTDIR/cache/arm64-base.tgz | |
| exit \$?' | |
| """ | |
| } | |
| } | |
| stage('Deploy') { | |
| archiveArtifacts artifacts: "cache/arm64-base.tgz", fingerprint: true | |
| } | |
| } | |
| } | |
| } |