diff --git a/custom-jobs/current-jobs.json b/custom-jobs/current-jobs.json index bec8310..5d52cc8 100644 --- a/custom-jobs/current-jobs.json +++ b/custom-jobs/current-jobs.json @@ -1,21 +1,23 @@ [ {"name": "Krita_Utilities_Setup", "pipeline": "krita/Krita_Utilities_Setup.pipeline", "cron": ""}, {"name": "Krita_Nightly_Appimage_Build", "pipeline": "krita/Krita_Nightly_Appimage_Build.pipeline", "cron": "@daily"}, {"name": "Krita_Nightly_Windows_Build", "pipeline": "krita/Krita_Nightly_Windows_Build.pipeline", "cron": "@daily"}, + {"name": "Krita_Nightly_MacOS_Build", "pipeline": "krita/Krita_Nightly_MacOS_Build.pipeline", "cron": "@daily"}, {"name": "Krita_Stable_Appimage_Build", "pipeline": "krita/Krita_Stable_Appimage_Build.pipeline", "cron": "@daily"}, {"name": "Krita_Stable_Windows_Build", "pipeline": "krita/Krita_Stable_Windows_Build.pipeline", "cron": "@daily"}, {"name": "Krita_Nightly_Windows_Dependency_Build", "pipeline": "krita/Krita_Nightly_Windows_Dependency_Build.pipeline", "cron": ""}, {"name": "Krita_Nightly_Appimage_Dependency_Build", "pipeline": "krita/Krita_Nightly_Appimage_Dependency_Build.pipeline", "cron": ""}, + {"name": "Krita_Nightly_MacOS_Dependency_Build", "pipeline": "krita/Krita_Nightly_MacOS_Dependency_Build.pipeline", "cron": ""}. {"name": "Krita_Release_Appimage_Build", "pipeline": "krita/Krita_Release_Appimage_Build.pipeline", "cron": ""}, {"name": "Krita_Release_Windows64_Build", "pipeline": "krita/Krita_Release_Windows64_Build.pipeline", "cron": ""}, {"name": "Krita_Release_Windows32_Build", "pipeline": "krita/Krita_Release_Windows32_Build.pipeline", "cron": ""}, {"name": "Krita_Release_Windows32_Dependency_Build", "pipeline": "krita/Krita_Release_Windows32_Dependency_Build.pipeline", "cron": ""}, {"name": "KMyMoney_Nightly_Appimage_Build", "pipeline": "kmymoney/KMyMoney_Nightly_Appimage_Build.pipeline", "cron": "@daily"}, {"name": "KMyMoney_Nightly_Appimage_Dependency_Build", "pipeline": "kmymoney/KMyMoney_Nightly_Appimage_Dependency_Build.pipeline", "cron": ""}, {"name": "KMyMoney_Release_Appimage_Build", "pipeline": "kmymoney/KMyMoney_Release_Appimage_Build.pipeline", "cron": ""}, {"name": "KMyMoney_Stable_Appimage_Build", "pipeline": "kmymoney/KMyMoney_Stable_Appimage_Build.pipeline", "cron": "@daily"}, {"name": "Kdenlive_Nightly_Appimage_Build", "pipeline": "kdenlive/Kdenlive_Nightly_Appimage_Build.pipeline", "cron": "@daily"}, {"name": "Kdenlive_Nightly_Appimage_Dependency_Build", "pipeline": "kdenlive/Kdenlive_Nightly_Appimage_Dependency_Build.pipeline", "cron": ""} ] diff --git a/custom-jobs/krita/Krita_Nightly_MacOS_Build.pipeline b/custom-jobs/krita/Krita_Nightly_MacOS_Build.pipeline new file mode 100644 index 0000000..c21c71d --- /dev/null +++ b/custom-jobs/krita/Krita_Nightly_MacOS_Build.pipeline @@ -0,0 +1,70 @@ +// Request a node to be allocated to us +node( "MacOS" ) { +// We want Timestamps on everything +timestamps { + // We want to catch any errors that occur to allow us to send out notifications (ie. emails) if needed + catchError { + + // First Thing: Checkout Sources + stage('Checkout Sources') { + // Make sure we have a clean slate to begin with + deleteDir() + + // Krita Code + checkout changelog: true, poll: true, scm: [ + $class: 'GitSCM', + branches: [[name: 'master']], + extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'krita/']], + userRemoteConfigs: [[url: 'https://anongit.kde.org/krita']] + ] + + } + + // Now retrieve the artifacts + stage('Retrieving Dependencies') { + // First we grab the artifacted dependencies built last time round + copyArtifacts filter: 'krita-macos-deps.tar', projectName: 'Krita_Nightly_MacOS_Dependency_Build' + + // Now we unpack them + // We also make sure our build workspace is ready at the same time + sh """ + export BUILDROOT=$HOME/KritaBuild/ + + [[ -d $BUILDROOT ]] || mkdir $BUILDROOT + [[ -s $BUILDROOT/krita ]] || ln -s $WORKSPACE/krita $BUILDROOT/krita + + cd $BUILDROOT + tar -xf $WORKSPACE/krita-macos-deps.tar + """ + } + + // Let's build Krita now that we have everything we need + stage('Building Krita') { + // The first parameter to the script is what it should be doing - which is building and installing Krita + // The workspace it uses was setup in the previous step + sh """ + export BUILDROOT=$HOME/KritaBuild/ + + bash krita/packaging/macos/osxbuild.sh buildinstall + """ + } + + // Now we can generate the actual DMG! + stage('Generating Krita DMG') { + // The scripts handle everything here, so just run them + sh """ + export BUILDROOT=$HOME/KritaBuild/ + + bash krita/packaging/macos/osxdeploy.sh + mv $BUILDROOT/*.dmg $WORKSPACE/ + """ + } + + // Finally we capture the DMG for distribution to users + stage('Capturing DMGs') { + // We use Jenkins artifacts for this to save having to setup additional infrastructure + archiveArtifacts artifacts: '*.dmg', onlyIfSuccessful: true + } + } +} +} diff --git a/custom-jobs/krita/Krita_Nightly_MacOS_Dependency_Build.pipeline b/custom-jobs/krita/Krita_Nightly_MacOS_Dependency_Build.pipeline new file mode 100644 index 0000000..3995c55 --- /dev/null +++ b/custom-jobs/krita/Krita_Nightly_MacOS_Dependency_Build.pipeline @@ -0,0 +1,58 @@ +// Request a node to be allocated to us +node( "MacOS" ) { +// We want Timestamps on everything +timestamps { + // We want to catch any errors that occur to allow us to send out notifications (ie. emails) if needed + catchError { + + // First Thing: Checkout Sources + stage('Checkout Sources') { + // Make sure we have a clean slate to begin with + deleteDir() + + // Krita Code + checkout changelog: true, poll: true, scm: [ + $class: 'GitSCM', + branches: [[name: 'master']], + extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'krita/']], + userRemoteConfigs: [[url: 'https://anongit.kde.org/krita']] + ] + + } + + // Now we can build the Dependencies for Krita's build + stage('Building Dependencies') { + // This is relatively straight forward + // We use some environment variables to tell the Krita scripts where we want them to put things + // Then we invoke them! + sh """ + export BUILDROOT=$HOME/KritaBuild/ + + [[ -d $BUILDROOT ]] || mkdir $BUILDROOT + [[ -s $BUILDROOT/krita ]] || ln -s $WORKSPACE/krita $BUILDROOT/krita + + bash krita/packaging/macos/osxbuild.sh builddeps + + cd ${BUILDROOT}/depbuild/ext_qt/ext_qt-prefix/src/ext_qt/qttools/src + make sub-macdeployqt-all + make sub-macdeployqt-install_subtargets + make install + """ + } + + // Now we capture them for use + stage('Capturing Dependencies') { + // First we tar all of the dependencies up... + sh """ + cd $HOME/KritaBuild/ + tar -cf $WORKSPACE/krita-macos-deps.tar i/ + + rm -rf $HOME/KritaBuild/ + """ + + // Then we ask Jenkins to capture the tar file as an artifact + archiveArtifacts artifacts: 'krita-macos-deps.tar', onlyIfSuccessful: true + } + } +} +}