ci: Begin CI pipeline
parent
4e05173ae1
commit
16a06d7637
|
@ -0,0 +1,30 @@
|
|||
BUILDROOT_SRC ?= ~/src/buildroot
|
||||
|
||||
.PHONY: all
|
||||
all: initramfs rootfs
|
||||
|
||||
.PHONY: rootfs
|
||||
rootfs: _build/rootfs/.config
|
||||
$(MAKE) -C _build/rootfs -j $(shell nproc)
|
||||
|
||||
.PHONY: initramfs
|
||||
initramfs: _build/initramfs/.config
|
||||
$(MAKE) -C _build/initramfs -j $(shell nproc)
|
||||
|
||||
.PHONY: publish
|
||||
publish:
|
||||
rsync -rtliO \
|
||||
_build/rootfs/images/rpi-firmware/ \
|
||||
_build/rootfs/images/Image \
|
||||
_build/rootfs/images/*.dtb \
|
||||
_build/initramfs/images/rootfs.cpio.lz4 \
|
||||
pxe0.pyrocufflink.blue:/var/lib/tftpboot/jenkinsagent-aarch64/
|
||||
rsync -P --no-W \
|
||||
_build/rootfs/images/rootfs.squashfs \
|
||||
pxe0.pyrocufflink.blue:/var/lib/nbd/jenkinsagent-aarch64.squashfs
|
||||
|
||||
_build/rootfs/.config:
|
||||
$(MAKE) -C $(BUILDROOT_SRC) O=${PWD}/_build/rootfs BR2_EXTERNAL=${PWD} jenkinsagent_defconfig
|
||||
|
||||
_build/initramfs/.config:
|
||||
$(MAKE) -C $(BUILDROOT_SRC) O=${PWD}/_build/initramfs BR2_EXTERNAL=${PWD} jenkinsagent_initramfs_defconfig
|
|
@ -0,0 +1,25 @@
|
|||
FROM registry.fedoraproject.org/fedora:30
|
||||
|
||||
ARG UID
|
||||
ARG GID
|
||||
|
||||
RUN groupadd -g ${GID} jenkins \
|
||||
&& useradd -u ${UID} -g ${GID} -m -d /var/lib/jenkins -l jenkins
|
||||
|
||||
RUN dnf install -y \
|
||||
bc \
|
||||
bzip2 \
|
||||
cpio \
|
||||
diffutils \
|
||||
g++ \
|
||||
gcc \
|
||||
make \
|
||||
ncurses-devel \
|
||||
openssh-clients \
|
||||
patch \
|
||||
perl-ExtUtils-MakeMaker \
|
||||
perl-Thread-Queue \
|
||||
rsync \
|
||||
wget \
|
||||
which \
|
||||
&& dnf clean all
|
|
@ -0,0 +1,82 @@
|
|||
pipeline {
|
||||
agent {
|
||||
dockerfile {
|
||||
dir 'ci'
|
||||
args '''
|
||||
-v /etc/ssh/ssh_known_hosts:/etc/ssh/ssh_known_hosts
|
||||
--pids-limit 16384
|
||||
'''
|
||||
additionalBuildArgs '''\
|
||||
--build-arg UID=$(id -u) \
|
||||
--build-arg GID=$(id -g) \
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
options {
|
||||
disableConcurrentBuilds()
|
||||
}
|
||||
|
||||
triggers {
|
||||
pollSCM ''
|
||||
}
|
||||
|
||||
parameters {
|
||||
booleanParam \
|
||||
name: 'Clean',
|
||||
description: 'Clean the workspace and perform a full rebuild'
|
||||
}
|
||||
|
||||
environment {
|
||||
BUILDROOT_SRC = "${env.WORKSPACE}/buildroot"
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Prepare') {
|
||||
steps {
|
||||
script {
|
||||
if (params.Clean) {
|
||||
sh 'rm -rf _build'
|
||||
}
|
||||
}
|
||||
checkout poll: false, scm: [
|
||||
$class: 'GitSCM',
|
||||
branches: [[name: '2022.02.x']],
|
||||
doGenerateSubmoduleConfigurations: false,
|
||||
userRemoteConfigs: [[url: 'git://git.buildroot.net/buildroot']],
|
||||
extensions: [
|
||||
[
|
||||
$class: 'RelativeTargetDirectory',
|
||||
relativeTargetDir: 'buildroot',
|
||||
],
|
||||
],
|
||||
]
|
||||
sh '. ci/prepare.sh'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build') {
|
||||
parallel {
|
||||
stage('Build Initramfs') {
|
||||
steps {
|
||||
sh '. ci/build-initramfs.sh'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build Rootfs') {
|
||||
steps {
|
||||
sh '. ci/build-rootfs.sh'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Publish') {
|
||||
steps {
|
||||
sshagent(['jenkins-pxe']) {
|
||||
sh '. ci/publish.sh'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
make initramfs
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
make rootfs
|
|
@ -0,0 +1 @@
|
|||
#!/bin/sh
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
make publish
|
Reference in New Issue