feat: Add Dockerfile and Jenkinsfile for build environment setup

This commit is contained in:
ParrotXray 2025-11-14 11:08:43 +08:00
parent 02d4d17119
commit f4653694ac
Signed by: ParrotXray
SSH Key Fingerprint: SHA256:OEnKoo72UOfrmZ3LVSBn9K/UfpEzNrl+q8JMLG9CaAI
2 changed files with 67 additions and 0 deletions

26
Dockerfile Normal file
View File

@ -0,0 +1,26 @@
FROM rust:latest
LABEL authors="ParrotXray"
LABEL description="CureOS Build Environment with Make"
RUN apt-get update && apt-get install -y \
build-essential \
make \
curl \
git \
qemu-system-x86 \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -ms /bin/bash -u 1000 jenkins && \
echo "jenkins ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
WORKDIR /app
RUN rustup install nightly && \
rustup default nightly && \
rustup component add rust-src && \
rustup target add x86_64-unknown-none
USER jenkins
CMD ["bash"]

41
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,41 @@
properties([
parameters([
string(
name: 'Build_Image',
defaultValue: 'All',
description: 'Build image in the jenkins'
)
])
])
node('ccis') {
stage('Setup Environment') {
cleanWs()
checkout scm
def image = docker.build('cureos-builder', '.')
env.IMAGE_ID = image.id
}
stage('Build with Make') {
docker.image(env.IMAGE_ID).inside("--user jenkins") {
sh '''
echo "=== Environment Check ==="
rustc --version
cargo --version
make --version
echo ""
echo "=== Building with Make ==="
make all
'''
}
}
stage('Archive') {
archiveArtifacts artifacts: 'build/**/*.img, bin/**/*',
fingerprint: true
}
}