ogcore/Jenkins/Jenkinsfile-deb-pkg

46 lines
1.4 KiB
Plaintext

pipeline {
agent {
label 'jenkins-slave'
}
environment {
DEBIAN_FRONTEND = 'noninteractive'
BUILD_DIR = "${WORKSPACE}/ogcore"
}
opfions {
skipDefaultCheckout()
}
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
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
'''
}
}
}
}