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/ ''' } archiveArtifacts artifacts: 'artifacts/*.deb', fingerprint: true } } stage ('Publish to Debian Repository') { agent { label 'debian-repo' } steps { script { sh "mkdir -p ${WORKSPACE}/debian-repo" } copyArtifacts projectName: env.JOB_NAME, filter: 'artifacts/*.deb', fingerprintArtifacts: true, target: 'debian-repo/' dir("${WORKSPACE}/debian-repo") { sh ''' aptly repo add opengnsys-devel *.deb ''' } } } } }