first commit
This commit is contained in:
Vendored
+136
@@ -0,0 +1,136 @@
|
|||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
|
||||||
|
environment {
|
||||||
|
PACKAGE_NAME = "espos-kernel"
|
||||||
|
APTLY_REPO = "espos-unstable"
|
||||||
|
|
||||||
|
APTLY_HOST = "ubuntu@elordenador.org"
|
||||||
|
|
||||||
|
DEB_FILE = "../*.deb"
|
||||||
|
}
|
||||||
|
|
||||||
|
stages {
|
||||||
|
|
||||||
|
stage('Checkout') {
|
||||||
|
steps {
|
||||||
|
checkout scm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Install Build Dependencies') {
|
||||||
|
steps {
|
||||||
|
sh '''
|
||||||
|
sudo apt update
|
||||||
|
|
||||||
|
sudo apt install -y \
|
||||||
|
build-essential \
|
||||||
|
bc \
|
||||||
|
bison \
|
||||||
|
flex \
|
||||||
|
libssl-dev \
|
||||||
|
libelf-dev \
|
||||||
|
dwarves \
|
||||||
|
fakeroot \
|
||||||
|
rsync \
|
||||||
|
kmod \
|
||||||
|
cpio \
|
||||||
|
wget \
|
||||||
|
curl \
|
||||||
|
xz-utils \
|
||||||
|
debhelper \
|
||||||
|
lintian
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build Kernel') {
|
||||||
|
steps {
|
||||||
|
sh '''
|
||||||
|
chmod +x build-kernel.sh
|
||||||
|
./build-kernel.sh
|
||||||
|
|
||||||
|
echo "=== Generated packages ==="
|
||||||
|
ls -lah ../*.deb
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Lintian Check') {
|
||||||
|
steps {
|
||||||
|
sh '''
|
||||||
|
lintian ../*.deb || true
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Upload to Aptly') {
|
||||||
|
steps {
|
||||||
|
sshagent(['srv01_elordenador_org']) {
|
||||||
|
sh '''
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
ssh-keyscan -H elordenador.org >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
scp ${DEB_FILE} ${APTLY_HOST}:/tmp/
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Publish Repository') {
|
||||||
|
steps {
|
||||||
|
sshagent(['srv01_elordenador_org']) {
|
||||||
|
|
||||||
|
withCredentials([
|
||||||
|
string(
|
||||||
|
credentialsId: 'aptly_gpg_pass',
|
||||||
|
variable: 'GPG_PASS'
|
||||||
|
)
|
||||||
|
]) {
|
||||||
|
|
||||||
|
sh '''
|
||||||
|
ssh ${APTLY_HOST} "
|
||||||
|
|
||||||
|
aptly repo add ${APTLY_REPO} /tmp/*.deb
|
||||||
|
|
||||||
|
if aptly publish list | grep -q ${APTLY_REPO}
|
||||||
|
then
|
||||||
|
aptly publish update \
|
||||||
|
-passphrase='${GPG_PASS}' \
|
||||||
|
${APTLY_REPO}
|
||||||
|
else
|
||||||
|
aptly publish repo \
|
||||||
|
-distribution=${APTLY_REPO} \
|
||||||
|
-component=main \
|
||||||
|
-passphrase='${GPG_PASS}' \
|
||||||
|
${APTLY_REPO}
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f /tmp/*.deb
|
||||||
|
"
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Archive Packages') {
|
||||||
|
steps {
|
||||||
|
archiveArtifacts(
|
||||||
|
artifacts: '../*.deb',
|
||||||
|
fingerprint: true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
post {
|
||||||
|
success {
|
||||||
|
echo 'Kernel publicado correctamente'
|
||||||
|
}
|
||||||
|
|
||||||
|
failure {
|
||||||
|
echo 'Error construyendo kernel'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euxo pipefail
|
||||||
|
|
||||||
|
KERNEL_VERSION="$(cat VERSION)"
|
||||||
|
|
||||||
|
wget \
|
||||||
|
https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${KERNEL_VERSION}.tar.xz
|
||||||
|
|
||||||
|
tar -xf linux-${KERNEL_VERSION}.tar.xz
|
||||||
|
|
||||||
|
cd linux-${KERNEL_VERSION}
|
||||||
|
|
||||||
|
cp ../config/kernel.config .config
|
||||||
|
|
||||||
|
make olddefconfig
|
||||||
|
|
||||||
|
for patch in ../patches/*.patch
|
||||||
|
do
|
||||||
|
[ -f "$patch" ] || continue
|
||||||
|
patch -p1 < "$patch"
|
||||||
|
done
|
||||||
|
|
||||||
|
scripts/config --set-str LOCALVERSION "-espos"
|
||||||
|
|
||||||
|
fakeroot make -j"$(nproc)" bindeb-pkg
|
||||||
+11462
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user