pipeline { agent any stages { stage('Pulling the repo ......') { steps { // Get some code from a GitHub repository git 'https://git.hamaralinux.org/devel/packages/swastik.git' } } stage('Preparing stage') { steps { echo 'Installing essentials ......' sh 'sudo apt-get update' sh 'sudo apt install -y debhelper build-essential devscripts germinate apt-utils figlet dpkg-dev fakeroot lintian pristine-tar' echo 'Dependencies installed ......' } } stage('Build calamares-settings-hamara') { steps { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { echo 'Building calamares-settings-hamara ......' dir('packages/calamares-settings-hamara'){ sh 'debuild -us -uc' } dir('packages'){ sh "mkdir -p ../build-dir/calamares-settings-hamara/" sh 'mv *.build *.buildinfo *.changes *.deb *.dsc ../build-dir/calamares-settings-hamara/' } } } } stage('Build hamara-config') { steps { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { echo 'Building hamara-config ......' dir('packages/hamara-config'){ sh 'debuild -us -uc' } dir('packages'){ sh "mkdir -p ../build-dir/hamara-config/" sh 'mv *.build *.buildinfo *.changes *.deb *.dsc ../build-dir/hamara-config/' } } } } stage('Build hamara-gfxboot-master') { steps { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { echo 'Building hamara-gfxboot-master ......' dir('packages/hamara-gfxboot-master'){ sh 'debuild -us -uc' } dir('packages'){ sh "mkdir -p ../build-dir/hamara-gfxboot-master/" sh 'mv *.build *.buildinfo *.changes *.deb *.dsc ../build-dir/hamara-gfxboot-master/' } } } } stage('Build hamara-gnome-meta') { steps { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { echo 'Building hamara-gnome-meta ......' dir('packages/hamara-gnome-meta'){ sh 'debuild -us -uc' } dir('packages'){ sh "mkdir -p ../build-dir/hamara-gnome-meta/" sh 'mv *.build *.buildinfo *.changes *.deb *.dsc ../build-dir/hamara-gnome-meta/' } } } } stage('Build hamara-keyring') { steps { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { echo 'Building hamara-keyring ......' dir('packages/hamara-keyring'){ sh 'debuild -us -uc' } dir('packages'){ sh "mkdir -p ../build-dir/hamara-keyring/" sh 'mv *.build *.buildinfo *.changes *.deb *.dsc ../build-dir/hamara-keyring/' } } } } stage('Build hamara-live') { steps { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { echo 'Building hamara-live ......' dir('packages/hamara-live'){ sh 'debuild -us -uc' } dir('packages'){ sh "mkdir -p ../build-dir/hamara-live/" sh 'mv *.build *.buildinfo *.changes *.deb *.dsc ../build-dir/hamara-live/' } } } } stage('Build hamara-theme') { steps { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { echo 'Building hamara-theme ......' dir('packages/hamara-theme'){ sh 'debuild -us -uc' } dir('packages'){ sh "mkdir -p ../build-dir/hamara-theme/" sh 'mv *.build *.buildinfo *.changes *.deb *.dsc ../build-dir/hamara-theme/' } } } } stage('Build hamara-wallpapers') { steps { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { echo 'Building hamara-wallpapers ......' dir('packages/hamara-wallpapers'){ sh 'debuild -us -uc' } dir('packages'){ sh "mkdir -p ../build-dir/hamara-wallpapers/" sh 'mv *.build *.buildinfo *.changes *.deb *.dsc ../build-dir/hamara-wallpapers/' } } } } stage('Build hamara-welcome') { steps { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { echo 'Building hamara-welcome ......' dir('packages/hamara-welcome'){ sh 'debuild -us -uc' } dir('packages'){ sh "mkdir -p ../build-dir/hamara-welcome/" sh 'mv *.build *.buildinfo *.changes *.deb *.dsc ../build-dir/hamara-welcome/' } } } } stage('Build plymouth-theme-hamara') { steps { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { echo 'Building plymouth-theme-hamara ......' dir('packages/plymouth-theme-hamara'){ sh 'debuild -us -uc' } dir('packages'){ sh "mkdir -p ../build-dir/plymouth-theme-hamara/" sh 'mv *.build *.buildinfo *.changes *.deb *.dsc ../build-dir/plymouth-theme-hamara/' } } } } stage('Uploading to aptly') { steps { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { withCredentials(bindings: [sshUserPrivateKey(credentialsId: 'aptly-hamaralinux.org', keyFileVariable: 'SSH_KEY_FOR_JENKINS')]) { echo 'Uplading packages to aptly ....' sh 'scp -r -i $SSH_KEY_FOR_JENKINS build-dir/* jenkins@192.168.122.1:/opt/hamara_repo_preliminary/hamara_custom_packages/' } } } } } }