diff --git a/custom-jobs/current-jobs.json b/custom-jobs/current-jobs.json index 91177e1..a8c6d0a 100644 --- a/custom-jobs/current-jobs.json +++ b/custom-jobs/current-jobs.json @@ -1,30 +1,38 @@ [ {"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_Android_Build", "pipeline": "krita/Krita_Nightly_Android_Build.pipeline", "cron": "@daily"}, + {"name": "Krita_Nightly_Android_arm64-v8a_Build", "pipeline": "krita/Krita_Nightly_Android_arm64-v8a_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_Stable_MacOS_Build", "pipeline": "krita/Krita_Stable_MacOS_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_Nightly_Android_Dependency_Build", "pipeline": "krita/Krita_Nightly_Android_Dependency_Build.pipeline", "cron": ""}, + + {"name": "Krita_Android_arm64-v8a_Dependency_Build", "pipeline": "krita/Krita_Android_arm64-v8a_Dependency_Build.pipeline", "cron": ""}, + {"name": "Krita_Android_armeabi-v7a_Dependency_Build", "pipeline": "krita/Krita_Android_armeabi-v7a_Dependency_Build.pipeline", "cron": ""}, + {"name": "Krita_Android_x86_Dependency_Build", "pipeline": "krita/Krita_Android_x86_64_Dependency_Build.pipeline", "cron": ""}, + {"name": "Krita_Android_x86_64_Dependency_Build", "pipeline": "krita/Krita_Android_x86_64_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": "Krita_Release_MacOS_Build", "pipeline": "krita/Krita_Release_MacOS_Build.pipeline", "cron": ""}, + {"name": "Krita_Release_Android_arm64-v8a_Build", "pipeline": "krita/Krita_Release_Android_arm64-v8a_Build.pipeline", "cron": ""}, + {"name": "Krita_Release_Android_armeabi-v7a_Build", "pipeline": "krita/Krita_Release_Android_armeabi-v7a_Build.pipeline", "cron": ""}, + {"name": "Krita_Release_Android_x86_Build", "pipeline": "krita/Krita_Release_Android_x86_64_Build.pipeline", "cron": ""}, + {"name": "Krita_Release_Android_x86_64_Build", "pipeline": "krita/Krita_Release_Android_x86_64_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_Android_Dependency_Build.pipeline b/custom-jobs/krita/Krita_Android_arm64-v8a_Dependency_Build.pipeline similarity index 100% copy from custom-jobs/krita/Krita_Nightly_Android_Dependency_Build.pipeline copy to custom-jobs/krita/Krita_Android_arm64-v8a_Dependency_Build.pipeline diff --git a/custom-jobs/krita/Krita_Nightly_Android_Dependency_Build.pipeline b/custom-jobs/krita/Krita_Android_armeabi-v7a_Dependency_Build.pipeline similarity index 98% copy from custom-jobs/krita/Krita_Nightly_Android_Dependency_Build.pipeline copy to custom-jobs/krita/Krita_Android_armeabi-v7a_Dependency_Build.pipeline index 6f3acdd..7d5fa47 100644 --- a/custom-jobs/krita/Krita_Nightly_Android_Dependency_Build.pipeline +++ b/custom-jobs/krita/Krita_Android_armeabi-v7a_Dependency_Build.pipeline @@ -1,64 +1,64 @@ // Request a node to be allocated to us node( "AndroidSDK" ) { // 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://invent.kde.org/graphics/krita.git']] ] } // Make sure the Android SDK is setup properly stage('Setting up SDK') { // For this we need to ensure that the Android 24 or later SDK is installed, otherwise the APK generation will fail sh """ sdkmanager "platforms;android-28" sdkmanager "ndk;18.1.5063045" """ } // Now we can build the Dependencies for Krita's build stage('Building Dependencies') { // This is relatively straight forward // For this we do need to unset QT_ANDROID though, to ensure it builds it's own patched version rather than using the normal one we rely on elsewhere // Then we invoke them! sh """ unset QT_ANDROID unset QMAKESPEC - export ANDROID_ABI=arm64-v8a + export ANDROID_ABI=armeabi-v7a export ANDROID_API_LEVEL=28 export CMAKE_ANDROID_NDK=$ANDROID_SDK_ROOT/ndk/18.1.5063045/ krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=boost krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=qt krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=3rdparty krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=kf5 """ } // Now we capture them for use stage('Capturing Dependencies') { // First we tar all of the dependencies up... sh """ tar -cf $WORKSPACE/krita-android-deps.tar build/i/ build/kf5/kde/install/ """ // Then we ask Jenkins to capture the tar file as an artifact archiveArtifacts artifacts: 'krita-android-deps.tar', onlyIfSuccessful: true } } } } diff --git a/custom-jobs/krita/Krita_Nightly_Android_Dependency_Build.pipeline b/custom-jobs/krita/Krita_Android_x86_64_Dependency_Build.pipeline similarity index 98% copy from custom-jobs/krita/Krita_Nightly_Android_Dependency_Build.pipeline copy to custom-jobs/krita/Krita_Android_x86_64_Dependency_Build.pipeline index 6f3acdd..14bafdd 100644 --- a/custom-jobs/krita/Krita_Nightly_Android_Dependency_Build.pipeline +++ b/custom-jobs/krita/Krita_Android_x86_64_Dependency_Build.pipeline @@ -1,64 +1,64 @@ // Request a node to be allocated to us node( "AndroidSDK" ) { // 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://invent.kde.org/graphics/krita.git']] ] } // Make sure the Android SDK is setup properly stage('Setting up SDK') { // For this we need to ensure that the Android 24 or later SDK is installed, otherwise the APK generation will fail sh """ sdkmanager "platforms;android-28" sdkmanager "ndk;18.1.5063045" """ } // Now we can build the Dependencies for Krita's build stage('Building Dependencies') { // This is relatively straight forward // For this we do need to unset QT_ANDROID though, to ensure it builds it's own patched version rather than using the normal one we rely on elsewhere // Then we invoke them! sh """ unset QT_ANDROID unset QMAKESPEC - export ANDROID_ABI=arm64-v8a + export ANDROID_ABI=x86_64 export ANDROID_API_LEVEL=28 export CMAKE_ANDROID_NDK=$ANDROID_SDK_ROOT/ndk/18.1.5063045/ krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=boost krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=qt krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=3rdparty krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=kf5 """ } // Now we capture them for use stage('Capturing Dependencies') { // First we tar all of the dependencies up... sh """ tar -cf $WORKSPACE/krita-android-deps.tar build/i/ build/kf5/kde/install/ """ // Then we ask Jenkins to capture the tar file as an artifact archiveArtifacts artifacts: 'krita-android-deps.tar', onlyIfSuccessful: true } } } } diff --git a/custom-jobs/krita/Krita_Nightly_Android_Dependency_Build.pipeline b/custom-jobs/krita/Krita_Android_x86_Dependency_Build.pipeline similarity index 98% rename from custom-jobs/krita/Krita_Nightly_Android_Dependency_Build.pipeline rename to custom-jobs/krita/Krita_Android_x86_Dependency_Build.pipeline index 6f3acdd..81476ce 100644 --- a/custom-jobs/krita/Krita_Nightly_Android_Dependency_Build.pipeline +++ b/custom-jobs/krita/Krita_Android_x86_Dependency_Build.pipeline @@ -1,64 +1,64 @@ // Request a node to be allocated to us node( "AndroidSDK" ) { // 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://invent.kde.org/graphics/krita.git']] ] } // Make sure the Android SDK is setup properly stage('Setting up SDK') { // For this we need to ensure that the Android 24 or later SDK is installed, otherwise the APK generation will fail sh """ sdkmanager "platforms;android-28" sdkmanager "ndk;18.1.5063045" """ } // Now we can build the Dependencies for Krita's build stage('Building Dependencies') { // This is relatively straight forward // For this we do need to unset QT_ANDROID though, to ensure it builds it's own patched version rather than using the normal one we rely on elsewhere // Then we invoke them! sh """ unset QT_ANDROID unset QMAKESPEC - export ANDROID_ABI=arm64-v8a + export ANDROID_ABI=x86 export ANDROID_API_LEVEL=28 export CMAKE_ANDROID_NDK=$ANDROID_SDK_ROOT/ndk/18.1.5063045/ krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=boost krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=qt krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=3rdparty krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=kf5 """ } // Now we capture them for use stage('Capturing Dependencies') { // First we tar all of the dependencies up... sh """ tar -cf $WORKSPACE/krita-android-deps.tar build/i/ build/kf5/kde/install/ """ // Then we ask Jenkins to capture the tar file as an artifact archiveArtifacts artifacts: 'krita-android-deps.tar', onlyIfSuccessful: true } } } } diff --git a/custom-jobs/krita/Krita_Nightly_Android_Build.pipeline b/custom-jobs/krita/Krita_Nightly_Android_arm64-v8a_Build.pipeline similarity index 100% copy from custom-jobs/krita/Krita_Nightly_Android_Build.pipeline copy to custom-jobs/krita/Krita_Nightly_Android_arm64-v8a_Build.pipeline diff --git a/custom-jobs/krita/Krita_Nightly_Android_Build.pipeline b/custom-jobs/krita/Krita_Release_Android_arm64-v8a_Build.pipeline similarity index 70% copy from custom-jobs/krita/Krita_Nightly_Android_Build.pipeline copy to custom-jobs/krita/Krita_Release_Android_arm64-v8a_Build.pipeline index c48762e..9b376ae 100644 --- a/custom-jobs/krita/Krita_Nightly_Android_Build.pipeline +++ b/custom-jobs/krita/Krita_Release_Android_arm64-v8a_Build.pipeline @@ -1,83 +1,97 @@ +// Ask for parameters we will need later on +def buildParameters = input( + message: 'Which version of Krita is being built?', + ok: 'Begin Build', + parameters: [ + string(defaultValue: '', description: '', name: 'Version', trim: true) + ] +) + +// Pull the version we've been given out to a separate variable +// We need to do this otherwise Jenkins will throw it's toys and claim we are violating a security sandbox which will expose our instance to vulnerabilites +// The Jenkins Security Sandbox is IMO broken and faulty in this regard +def buildVersion = buildParameters ?: '' + // Request a node to be allocated to us node( "AndroidSDK" ) { // 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://invent.kde.org/graphics/krita.git']] - ] + // Now we download the release tarball, unpack it and rename the directory to something more convenient to use everywhere else + sh """ + wget "https://origin.files.kde.org/krita/.release/${buildVersion}/krita-${buildVersion}.tar.gz" + tar -xf "$WORKSPACE/krita-${buildVersion}.tar.gz" + + mv krita-${buildVersion} krita + """ } // Now retrieve the artifacts stage('Retrieving Dependencies') { // First we grab the artifacted dependencies built last time round - copyArtifacts filter: 'krita-android-deps.tar', projectName: 'Krita_Nightly_Android_Dependency_Build' + copyArtifacts filter: 'krita-android-deps.tar', projectName: 'Krita_Android_arm64-v8a_Dependency_Build' // Now we unpack them sh """ tar -xf $WORKSPACE/krita-android-deps.tar """ } // Make sure the Android SDK is setup properly stage('Setting up SDK') { // For this we need to ensure that the Android 24 or later SDK is installed, otherwise the APK generation will fail sh """ sdkmanager "platforms;android-28" sdkmanager "ndk;18.1.5063045" """ } // Let's build Krita that we have everything we need stage('Building Krita') { // The first parameter to the script is where the scripts should work - which is our workspace in this case // Otherwise we leave everything in the hands of that script sh """ unset QT_ANDROID unset QMAKESPEC export ANDROID_ABI=arm64-v8a export ANDROID_API_LEVEL=28 export CMAKE_ANDROID_NDK=$ANDROID_SDK_ROOT/ndk/18.1.5063045/ krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=krita-bin """ } // Now we can generate the actual APKs! stage('Generating Krita APK') { // The scripts handle everything here, so just run them sh """ unset QT_ANDROID unset QMAKESPEC export ANDROID_ABI=arm64-v8a export ANDROID_API_LEVEL=28 export CMAKE_ANDROID_NDK=$ANDROID_NDK_ROOT krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=apk mv $WORKSPACE/build/krita_build_apk/build/outputs/apk/*/*.apk ./ """ } // Finally we capture the APKs for distribution to users stage('Capturing APKs') { // We use Jenkins artifacts for this to save having to setup additional infrastructure archiveArtifacts artifacts: '*.apk', onlyIfSuccessful: true } } } } diff --git a/custom-jobs/krita/Krita_Nightly_Android_Build.pipeline b/custom-jobs/krita/Krita_Release_Android_armeabi-v7a_Build.pipeline similarity index 69% copy from custom-jobs/krita/Krita_Nightly_Android_Build.pipeline copy to custom-jobs/krita/Krita_Release_Android_armeabi-v7a_Build.pipeline index c48762e..1929984 100644 --- a/custom-jobs/krita/Krita_Nightly_Android_Build.pipeline +++ b/custom-jobs/krita/Krita_Release_Android_armeabi-v7a_Build.pipeline @@ -1,83 +1,97 @@ +// Ask for parameters we will need later on +def buildParameters = input( + message: 'Which version of Krita is being built?', + ok: 'Begin Build', + parameters: [ + string(defaultValue: '', description: '', name: 'Version', trim: true) + ] +) + +// Pull the version we've been given out to a separate variable +// We need to do this otherwise Jenkins will throw it's toys and claim we are violating a security sandbox which will expose our instance to vulnerabilites +// The Jenkins Security Sandbox is IMO broken and faulty in this regard +def buildVersion = buildParameters ?: '' + // Request a node to be allocated to us node( "AndroidSDK" ) { // 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://invent.kde.org/graphics/krita.git']] - ] + // Now we download the release tarball, unpack it and rename the directory to something more convenient to use everywhere else + sh """ + wget "https://origin.files.kde.org/krita/.release/${buildVersion}/krita-${buildVersion}.tar.gz" + + tar -xf "$WORKSPACE/krita-${buildVersion}.tar.gz" + mv krita-${buildVersion} krita + """ } // Now retrieve the artifacts stage('Retrieving Dependencies') { // First we grab the artifacted dependencies built last time round - copyArtifacts filter: 'krita-android-deps.tar', projectName: 'Krita_Nightly_Android_Dependency_Build' + copyArtifacts filter: 'krita-android-deps.tar', projectName: 'Krita_Android_armeabi-v7a_Dependency_Build' // Now we unpack them sh """ tar -xf $WORKSPACE/krita-android-deps.tar """ } // Make sure the Android SDK is setup properly stage('Setting up SDK') { // For this we need to ensure that the Android 24 or later SDK is installed, otherwise the APK generation will fail sh """ sdkmanager "platforms;android-28" sdkmanager "ndk;18.1.5063045" """ } // Let's build Krita that we have everything we need stage('Building Krita') { // The first parameter to the script is where the scripts should work - which is our workspace in this case // Otherwise we leave everything in the hands of that script sh """ unset QT_ANDROID unset QMAKESPEC - export ANDROID_ABI=arm64-v8a + export ANDROID_ABI=armeabi-v7a export ANDROID_API_LEVEL=28 export CMAKE_ANDROID_NDK=$ANDROID_SDK_ROOT/ndk/18.1.5063045/ krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=krita-bin """ } // Now we can generate the actual APKs! stage('Generating Krita APK') { // The scripts handle everything here, so just run them sh """ unset QT_ANDROID unset QMAKESPEC export ANDROID_ABI=arm64-v8a export ANDROID_API_LEVEL=28 export CMAKE_ANDROID_NDK=$ANDROID_NDK_ROOT krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=apk mv $WORKSPACE/build/krita_build_apk/build/outputs/apk/*/*.apk ./ """ } // Finally we capture the APKs for distribution to users stage('Capturing APKs') { // We use Jenkins artifacts for this to save having to setup additional infrastructure archiveArtifacts artifacts: '*.apk', onlyIfSuccessful: true } } } } diff --git a/custom-jobs/krita/Krita_Nightly_Android_Build.pipeline b/custom-jobs/krita/Krita_Release_Android_x86_64_Build.pipeline similarity index 69% copy from custom-jobs/krita/Krita_Nightly_Android_Build.pipeline copy to custom-jobs/krita/Krita_Release_Android_x86_64_Build.pipeline index c48762e..4f85c4d 100644 --- a/custom-jobs/krita/Krita_Nightly_Android_Build.pipeline +++ b/custom-jobs/krita/Krita_Release_Android_x86_64_Build.pipeline @@ -1,83 +1,97 @@ +// Ask for parameters we will need later on +def buildParameters = input( + message: 'Which version of Krita is being built?', + ok: 'Begin Build', + parameters: [ + string(defaultValue: '', description: '', name: 'Version', trim: true) + ] +) + +// Pull the version we've been given out to a separate variable +// We need to do this otherwise Jenkins will throw it's toys and claim we are violating a security sandbox which will expose our instance to vulnerabilites +// The Jenkins Security Sandbox is IMO broken and faulty in this regard +def buildVersion = buildParameters ?: '' + // Request a node to be allocated to us node( "AndroidSDK" ) { // 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://invent.kde.org/graphics/krita.git']] - ] + // Now we download the release tarball, unpack it and rename the directory to something more convenient to use everywhere else + sh """ + wget "https://origin.files.kde.org/krita/.release/${buildVersion}/krita-${buildVersion}.tar.gz" + + tar -xf "$WORKSPACE/krita-${buildVersion}.tar.gz" + mv krita-${buildVersion} krita + """ } // Now retrieve the artifacts stage('Retrieving Dependencies') { // First we grab the artifacted dependencies built last time round - copyArtifacts filter: 'krita-android-deps.tar', projectName: 'Krita_Nightly_Android_Dependency_Build' + copyArtifacts filter: 'krita-android-deps.tar', projectName: 'Krita_Android_x86_64_Dependency_Build' // Now we unpack them sh """ tar -xf $WORKSPACE/krita-android-deps.tar """ } // Make sure the Android SDK is setup properly stage('Setting up SDK') { // For this we need to ensure that the Android 24 or later SDK is installed, otherwise the APK generation will fail sh """ sdkmanager "platforms;android-28" sdkmanager "ndk;18.1.5063045" """ } // Let's build Krita that we have everything we need stage('Building Krita') { // The first parameter to the script is where the scripts should work - which is our workspace in this case // Otherwise we leave everything in the hands of that script sh """ unset QT_ANDROID unset QMAKESPEC - export ANDROID_ABI=arm64-v8a + export ANDROID_ABI=x86_64 export ANDROID_API_LEVEL=28 export CMAKE_ANDROID_NDK=$ANDROID_SDK_ROOT/ndk/18.1.5063045/ krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=krita-bin """ } // Now we can generate the actual APKs! stage('Generating Krita APK') { // The scripts handle everything here, so just run them sh """ unset QT_ANDROID unset QMAKESPEC export ANDROID_ABI=arm64-v8a export ANDROID_API_LEVEL=28 export CMAKE_ANDROID_NDK=$ANDROID_NDK_ROOT krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=apk mv $WORKSPACE/build/krita_build_apk/build/outputs/apk/*/*.apk ./ """ } // Finally we capture the APKs for distribution to users stage('Capturing APKs') { // We use Jenkins artifacts for this to save having to setup additional infrastructure archiveArtifacts artifacts: '*.apk', onlyIfSuccessful: true } } } } diff --git a/custom-jobs/krita/Krita_Nightly_Android_Build.pipeline b/custom-jobs/krita/Krita_Release_Android_x86_Build.pipeline similarity index 70% rename from custom-jobs/krita/Krita_Nightly_Android_Build.pipeline rename to custom-jobs/krita/Krita_Release_Android_x86_Build.pipeline index c48762e..b993294 100644 --- a/custom-jobs/krita/Krita_Nightly_Android_Build.pipeline +++ b/custom-jobs/krita/Krita_Release_Android_x86_Build.pipeline @@ -1,83 +1,97 @@ +// Ask for parameters we will need later on +def buildParameters = input( + message: 'Which version of Krita is being built?', + ok: 'Begin Build', + parameters: [ + string(defaultValue: '', description: '', name: 'Version', trim: true) + ] +) + +// Pull the version we've been given out to a separate variable +// We need to do this otherwise Jenkins will throw it's toys and claim we are violating a security sandbox which will expose our instance to vulnerabilites +// The Jenkins Security Sandbox is IMO broken and faulty in this regard +def buildVersion = buildParameters ?: '' + // Request a node to be allocated to us node( "AndroidSDK" ) { // 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://invent.kde.org/graphics/krita.git']] - ] + // Now we download the release tarball, unpack it and rename the directory to something more convenient to use everywhere else + sh """ + wget "https://origin.files.kde.org/krita/.release/${buildVersion}/krita-${buildVersion}.tar.gz" + + tar -xf "$WORKSPACE/krita-${buildVersion}.tar.gz" + mv krita-${buildVersion} krita + """ } // Now retrieve the artifacts stage('Retrieving Dependencies') { // First we grab the artifacted dependencies built last time round - copyArtifacts filter: 'krita-android-deps.tar', projectName: 'Krita_Nightly_Android_Dependency_Build' + copyArtifacts filter: 'krita-android-deps.tar', projectName: 'Krita_Android_x86_Dependency_Build' // Now we unpack them sh """ tar -xf $WORKSPACE/krita-android-deps.tar """ } // Make sure the Android SDK is setup properly stage('Setting up SDK') { // For this we need to ensure that the Android 24 or later SDK is installed, otherwise the APK generation will fail sh """ sdkmanager "platforms;android-28" sdkmanager "ndk;18.1.5063045" """ } // Let's build Krita that we have everything we need stage('Building Krita') { // The first parameter to the script is where the scripts should work - which is our workspace in this case // Otherwise we leave everything in the hands of that script sh """ unset QT_ANDROID unset QMAKESPEC - export ANDROID_ABI=arm64-v8a + export ANDROID_ABI=x86 export ANDROID_API_LEVEL=28 export CMAKE_ANDROID_NDK=$ANDROID_SDK_ROOT/ndk/18.1.5063045/ krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=krita-bin """ } // Now we can generate the actual APKs! stage('Generating Krita APK') { // The scripts handle everything here, so just run them sh """ unset QT_ANDROID unset QMAKESPEC export ANDROID_ABI=arm64-v8a export ANDROID_API_LEVEL=28 export CMAKE_ANDROID_NDK=$ANDROID_NDK_ROOT krita/packaging/android/androidbuild.sh --src=$WORKSPACE/krita/ --build-type=Release --build-root=$WORKSPACE/build/ -p=apk mv $WORKSPACE/build/krita_build_apk/build/outputs/apk/*/*.apk ./ """ } // Finally we capture the APKs for distribution to users stage('Capturing APKs') { // We use Jenkins artifacts for this to save having to setup additional infrastructure archiveArtifacts artifacts: '*.apk', onlyIfSuccessful: true } } } }