From 1d1c45d777b521caa17471fa31d7b7a16018f2bf Mon Sep 17 00:00:00 2001 From: LinlyBoi Date: Sun, 13 Jul 2025 20:43:50 +0300 Subject: [PATCH] ci: removed some things --- Jenkinsfile | 81 +++++++++-------------------------------------------- 1 file changed, 13 insertions(+), 68 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b0b1124..cdcf5f8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,120 +1,65 @@ pipeline { agent { dockerContainer { - image 'rust:1.75' // Use official Rust Docker image - args '-v $HOME/.cargo:/root/.cargo' // Cache Cargo dependencies + image 'rust:1.75' } } - triggers { - // Trigger build on SCM changes (pushes) - pollSCM('H/5 * * * *') // Poll SCM every 5 minutes - } - environment { - // Rust environment variables - CARGO_HOME = '/root/.cargo' - RUSTUP_HOME = '/root/.rustup' - // Optional: Set specific Rust version - // RUST_VERSION = '1.75.0' + CARGO_HOME = '/usr/local/cargo' + RUSTUP_HOME = '/usr/local/rustup' } stages { stage('Checkout') { steps { - // Checkout source code checkout scm } } - stage('Rust Info') { + stage('Setup Environment') { steps { - // Display Rust and Cargo versions - sh 'rustc --version' sh 'cargo --version' + sh 'rustc --version' + sh 'mkdir -p target' + sh 'mkdir -p ~/.cargo/registry' } } - stage('Cache Dependencies') { + stage('Build Dependencies') { steps { - // Update Cargo index and cache dependencies sh 'cargo fetch' } } - stage('Lint') { + stage('Run Tests') { steps { - // Run clippy for linting - sh 'cargo clippy -- -D warnings' - } - } - - stage('Format Check') { - steps { - // Check code formatting - sh 'cargo fmt -- --check' - } - } - - stage('Build') { - steps { - // Build the project - sh 'cargo build --release' - } - } - - stage('Test') { - steps { - // Run tests sh 'cargo test --release' } } - stage('Security Audit') { + stage('Build Binary') { steps { - // Optional: Run security audit - script { - try { - sh 'cargo install cargo-audit || true' - sh 'cargo audit' - } catch (Exception e) { - echo "Security audit failed or not available: ${e.getMessage()}" - } - } + sh 'cargo build --release' } } - stage('Archive Artifacts') { + stage('Archive') { steps { - // Archive build artifacts - script { - // Find and archive binary files - sh 'find target/release -maxdepth 1 -type f -executable -not -name "*.so" -not -name "*.d" | head -10' - - // Archive the main binary (adjust name as needed) - archiveArtifacts artifacts: 'target/release/*', allowEmptyArchive: true, fingerprint: true - } + archiveArtifacts artifacts: 'target/release/**', allowEmptyArchive: true } } } post { always { - // Clean workspace after build cleanWs() } - success { echo 'Rust build completed successfully!' } - failure { echo 'Rust build failed!' - // Optional: Send notifications - } - - unstable { - echo 'Rust build completed with warnings!' } } }