feat: Add Dockerfile and Jenkinsfile for build environment setup
This commit is contained in:
parent
02d4d17119
commit
f4653694ac
26
Dockerfile
Normal file
26
Dockerfile
Normal 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
41
Jenkinsfile
vendored
Normal 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
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user