Add Jenkinsfile to build deb pkg
testing/ogGui-multibranch/pipeline/head This commit looks good Details

jenkins-deb
Nicolas Arenas 2025-03-17 16:40:22 +01:00
parent 251708e21e
commit c41ca6e8ce
1 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,49 @@
pipeline {
agent {
label 'jenkins-slave'
}
environment {
DEBIAN_FRONTEND = 'noninteractive'
}
options {
skipDefaultCheckout()
}
stages {
stage('Prepare Workspace') {
steps {
script {
env.BUILD_DIR = "${WORKSPACE}/ogcore"
sh "mkdir -p ${env.BUILD_DIR}"
}
}
}
stage('Checkout') {
steps {
dir("${env.BUILD_DIR}") {
checkout scm
}
}
}
stage('Build') {
steps {
dir("${env.BUILD_DIR}") {
sh '''
composer require symfony/flex
dpkg-buildpackage -us -uc
mkdir -p ../artifacts && mv ../*.deb ../*.changes ../*.buildinfo ../artifacts/
ssh aptly@172.17.8.68 "rm -rf /var/tmp/opengnsys/debian-repo && mkdir -p /var/tmp/opengnsys/debian-repo"
scp -r ../artifacts/* aptly@172.17.8.68:/var/tmp/opengnsys/debian-repo/
'''
}
}
}
stage ('Publish to Debian Repository') {
agent { label 'debian-repo' }
steps {
sh "aptly repo add opengnsys-devel /var/tmp/opengnsys/debian-repo/*.deb"
}
}
}
}