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" } } } }