Initial commit
This commit is contained in:
67
ci/Jenkinsfile
vendored
Normal file
67
ci/Jenkinsfile
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
DOCKER_BUILD_ARGS = '''\
|
||||
--build-arg UID=$(id -u) \
|
||||
--build-arg GID=$(id -g) \
|
||||
'''
|
||||
|
||||
pipeline {
|
||||
agent {
|
||||
label 'docker && aarch64'
|
||||
}
|
||||
|
||||
options {
|
||||
buildDiscarder logRotator(numToKeepStr: '5')
|
||||
disableConcurrentBuilds()
|
||||
}
|
||||
|
||||
triggers {
|
||||
pollSCM ''
|
||||
}
|
||||
|
||||
parameters {
|
||||
booleanParam \
|
||||
name: 'Clean',
|
||||
description: 'Clean the workspace and perform a full rebuild'
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Build') {
|
||||
agent {
|
||||
dockerfile {
|
||||
reuseNode true
|
||||
dir 'ci'
|
||||
args '--privileged -u 0:0'
|
||||
additionalBuildArgs DOCKER_BUILD_ARGS
|
||||
}
|
||||
}
|
||||
steps {
|
||||
script {
|
||||
if (params.Clean) {
|
||||
sh 'rm -rf _build'
|
||||
}
|
||||
}
|
||||
sh 'make rootfs initramfs'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Publish') {
|
||||
when {
|
||||
not {
|
||||
changeRequest()
|
||||
}
|
||||
}
|
||||
agent {
|
||||
dockerfile {
|
||||
reuseNode true
|
||||
dir 'ci'
|
||||
args '-v /etc/ssh/ssh_known_hosts:/etc/ssh/ssh_known_hosts'
|
||||
additionalBuildArgs DOCKER_BUILD_ARGS
|
||||
}
|
||||
}
|
||||
steps {
|
||||
sshagent(['jenkins-pxe']) {
|
||||
sh 'make publish'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user