Switch back to main repo

This commit is contained in:
Gamerboy59 2024-09-10 23:24:15 +02:00 committed by GitHub
commit f860bfa52a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

24
.build/Jenkinsfile vendored
View file

@ -1,14 +1,14 @@
pipeline { pipeline {
agent none agent none
environment { environment {
// Define common variables used throughout the pipeline // Define common variables used throughout the pipeline
REPO_URL = 'https://github.com/Gamerboy59/rust-rpxy.git' REPO_URL = 'https://github.com/junkurihara/rust-rpxy.git'
BINARY_NAME = 'rpxy' BINARY_NAME = 'rpxy'
// BUILD_VERSION is not set because it will be extracted from Cargo.toml in the first step // BUILD_VERSION is not set because it will be extracted from Cargo.toml in the first step
BUILD_VERSION = '' BUILD_VERSION = ''
} }
stages { stages {
stage('Prepare Build Environment') { stage('Prepare Build Environment') {
agent { agent {
@ -31,7 +31,7 @@ pipeline {
container('rust-cargo') { container('rust-cargo') {
// Install git // Install git
sh 'apt-get update && apt-get -y install git --no-install-recommends' sh 'apt-get update && apt-get -y install git --no-install-recommends'
// Clone and Prepare Repository // Clone and Prepare Repository
sh "git clone ${REPO_URL}" sh "git clone ${REPO_URL}"
@ -43,7 +43,7 @@ pipeline {
# Initialize and update submodules # Initialize and update submodules
git submodule update --init git submodule update --init
""" """
// Extract BUILD_VERSION from Cargo.toml // Extract BUILD_VERSION from Cargo.toml
script { script {
// Extract version from Cargo.toml and set it as an environment variable // Extract version from Cargo.toml and set it as an environment variable
@ -79,7 +79,7 @@ pipeline {
} }
} }
} }
stage('Build RPM Package') { stage('Build RPM Package') {
agent { agent {
kubernetes { kubernetes {
@ -104,10 +104,10 @@ pipeline {
unstash 'rpm-files' unstash 'rpm-files'
unstash 'service-file' unstash 'service-file'
unstash 'docs' unstash 'docs'
// Install necessary tools for RPM building // Install necessary tools for RPM building
sh 'dnf update -y && dnf install -y rpmdevtools tar' sh 'dnf update -y && dnf install -y rpmdevtools tar'
// Create the RPM package // Create the RPM package
sh """ sh """
# Create RPM build directory structure # Create RPM build directory structure
@ -125,13 +125,13 @@ pipeline {
# Build the RPM package # Build the RPM package
rpmbuild --define "_topdir ${WORKSPACE}/rpmbuild" --define "_version ${BUILD_VERSION}" -bb rpmbuild/SPECS/${BINARY_NAME}.spec rpmbuild --define "_topdir ${WORKSPACE}/rpmbuild" --define "_version ${BUILD_VERSION}" -bb rpmbuild/SPECS/${BINARY_NAME}.spec
""" """
// Archive the RPM package // Archive the RPM package
archiveArtifacts artifacts: "rpmbuild/RPMS/x86_64/${BINARY_NAME}-${BUILD_VERSION}-1.el9.x86_64.rpm", allowEmptyArchive: false, fingerprint: true archiveArtifacts artifacts: "rpmbuild/RPMS/x86_64/${BINARY_NAME}-${BUILD_VERSION}-1.el9.x86_64.rpm", allowEmptyArchive: false, fingerprint: true
} }
} }
} }
stage('Build DEB Package') { stage('Build DEB Package') {
agent { agent {
kubernetes { kubernetes {
@ -159,7 +159,7 @@ pipeline {
// Install necessary tools for DEB building // Install necessary tools for DEB building
sh 'apt-get update && apt-get install -y dpkg-dev --no-install-recommends' sh 'apt-get update && apt-get install -y dpkg-dev --no-install-recommends'
// Create the DEB package // Create the DEB package
sh """ sh """
# Define DEB package directory # Define DEB package directory
@ -185,7 +185,7 @@ pipeline {
# Build the DEB package # Build the DEB package
dpkg-deb --build --root-owner-group $DEB_DIR dpkg-deb --build --root-owner-group $DEB_DIR
""" """
// Archive the DEB package // Archive the DEB package
archiveArtifacts artifacts: "${DEB_DIR}.deb", allowEmptyArchive: false, fingerprint: true archiveArtifacts artifacts: "${DEB_DIR}.deb", allowEmptyArchive: false, fingerprint: true
} }