ogcore/Jenkins/Jenkinsfile-deb-pkg

43 lines
1.3 KiB
Plaintext

pipeline {
agent {
label 'jenkins-slave'
}
environment {
DEBIAN_FRONTEND = 'noninteractive'
BUILD_DIR = "${WORKSPACE}/source"
}
stages {
stage('Checkout') {
steps {
script {
sh "mkdir -p ${BUILD_DIR}" // Creamos el directorio
dir("${BUILD_DIR}") {
checkout scm // Hacemos el checkout en el subdirectorio
}
}
}
}
stage('Build') {
steps {
dir ("${BUILD_DIR}") {
sh '''
composer require symfony/flex
dpkg-buildpackage -us -uc
sh 'mkdir -p ../artifacts && mv ../*.deb ../*.changes ../*.buildinfo ../artifacts/'
'''
}
archiveArtifacts artifacts: 'artifacts/*.deb', fingerprint: true
}
}
stage ('Publish to Debian Repository') {
agent { label 'debian-repo' }
steps {
copyArtifacts projectName: env.JOB_NAME, filter: 'artifacts/*.deb', fingerprintArtifacts: true, target: 'debian-repo/'
sh '''
aptly repo add opengsnys-devel debian-repo/*.deb
'''
}
}
}
}