mirror of
https://github.com/antos-rde/antos.git
synced 2025-07-16 05:49:57 +02:00
feat: Support CI and cross compile for amd64, arm64, arm
All checks were successful
gitea-sync/antos/pipeline/head This commit looks good
All checks were successful
gitea-sync/antos/pipeline/head This commit looks good
This commit is contained in:
90
Jenkinsfile
vendored
Normal file
90
Jenkinsfile
vendored
Normal file
@ -0,0 +1,90 @@
|
||||
pipeline {
|
||||
agent {
|
||||
docker {
|
||||
image 'xsangle/ci-tools:latest'
|
||||
reuseNode true
|
||||
args ' --device /dev/fuse --privileged '
|
||||
}
|
||||
}
|
||||
options {
|
||||
// Limit build history with buildDiscarder option:
|
||||
// daysToKeepStr: history is only kept up to this many days.
|
||||
// numToKeepStr: only this many build logs are kept.
|
||||
// artifactDaysToKeepStr: artifacts are only kept up to this many days.
|
||||
// artifactNumToKeepStr: only this many builds have their artifacts kept.
|
||||
buildDiscarder(logRotator(numToKeepStr: '1'))
|
||||
// Enable timestamps in build log console
|
||||
timestamps()
|
||||
// Maximum time to run the whole pipeline before canceling it
|
||||
timeout(time: 3, unit: 'HOURS')
|
||||
// Use Jenkins ANSI Color Plugin for log console
|
||||
ansiColor('xterm')
|
||||
// Limit build concurrency to 1 per branch
|
||||
disableConcurrentBuilds()
|
||||
}
|
||||
stages
|
||||
{
|
||||
stage('Prepare dependencies') {
|
||||
agent {
|
||||
node { label'workstation' }
|
||||
}
|
||||
steps {
|
||||
sh'''
|
||||
cd antd/luasocket && git stash || true
|
||||
cd $WORKSPACE
|
||||
git submodule update --init
|
||||
make clean || true
|
||||
rm -rf build/* || true
|
||||
mkdir build || true
|
||||
'''
|
||||
}
|
||||
}
|
||||
stage('Build AMD64)') {
|
||||
steps {
|
||||
sh'''
|
||||
DESTDIR=$(realpath build) \
|
||||
ARCH=amd64 \
|
||||
RUSTUP_HOME=/opt/rust/rustup \
|
||||
CARGO_HOME=/opt/rust/cargo \
|
||||
make all deb appimg
|
||||
'''
|
||||
}
|
||||
}
|
||||
stage('Build ARM64)') {
|
||||
steps {
|
||||
sh'''
|
||||
DESTDIR=$(realpath build) \
|
||||
ARCH=arm64 \
|
||||
RUSTUP_HOME=/opt/rust/rustup \
|
||||
CARGO_HOME=/opt/rust/cargo \
|
||||
make all deb appimg
|
||||
'''
|
||||
}
|
||||
}
|
||||
stage('Build ARM)') {
|
||||
steps {
|
||||
sh'''
|
||||
DESTDIR=$(realpath build) \
|
||||
ARCH=arm \
|
||||
RUSTUP_HOME=/opt/rust/rustup \
|
||||
CARGO_HOME=/opt/rust/cargo \
|
||||
make all deb appimg
|
||||
'''
|
||||
}
|
||||
}
|
||||
stage('Checking build)') {
|
||||
steps {
|
||||
sh'''
|
||||
./scripts/ckarch.sh build
|
||||
'''
|
||||
}
|
||||
}
|
||||
stage('Archive') {
|
||||
steps {
|
||||
script {
|
||||
archiveArtifacts artifacts: 'build/', fingerprint: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user