diff --git a/ci/Jenkinsfile.e2e b/ci/Jenkinsfile.e2e deleted file mode 100644 index e49d453cfa1..00000000000 --- a/ci/Jenkinsfile.e2e +++ /dev/null @@ -1,182 +0,0 @@ -library 'status-jenkins-lib@v1.6.3' - -/* Options section can't access functions in objects. */ -def isPRBuild = utils.isPRBuild() - -pipeline { - agent { label 'linux' } - - parameters { - booleanParam( - name: 'RELEASE', - description: 'Decides whether binaries are built with debug symbols.', - defaultValue: params.RELEASE ?: false - ) - choice( - name: 'VERBOSE', - description: 'Level of verbosity based on nimbus-build-system setup.', - choices: ['0', '1', '2'] - ) - } - - options { - timestamps() - /* Prevent Jenkins jobs from running forever */ - timeout(time: 120, unit: 'MINUTES') - /* manage how many builds we keep */ - buildDiscarder(logRotator( - numToKeepStr: '10', - daysToKeepStr: '30', - artifactNumToKeepStr: '3', - )) - /* Throttle number of concurrent builds. */ - throttleJobProperty( - throttleEnabled: true, - throttleOption: 'category', - maxConcurrentPerNode: 1, - maxConcurrentTotal: 10 - ) - /* Abort old PR builds. */ - disableConcurrentBuilds( - abortPrevious: isPRBuild - ) - } - - environment { - TARGET = 'linux-e2e' - /* Improve make performance */ - MAKEFLAGS = "-j4 V=${params.VERBOSE}" - /* Disable colors in Nim compiler logs */ - NIMFLAGS = '--colors:off' - /* Makefile assumes the compiler folder is included */ - QTDIR = '/opt/qt/5.14.2/gcc_64' - /* Include library in order to compile the project */ - LD_LIBRARY_PATH = "$QTDIR/lib:$WORKSPACE/vendor/status-go/build/bin:$WORKSPACE/vendor/status-keycard-go/build/libkeycard/" - /* Container ports */ - RPC_PORT = "${8545 + env.EXECUTOR_NUMBER.toInteger()}" - P2P_PORT = "${6010 + env.EXECUTOR_NUMBER.toInteger()}" - /* Ganache config */ - GANACHE_RPC_PORT = "${9545 + env.EXECUTOR_NUMBER.toInteger()}" - GANACHE_MNEMONIC = 'pelican chief sudden oval media rare swamp elephant lawsuit wheat knife initial' - } - - stages { - stage('Deps') { - steps { - sh 'make update' - sh 'make deps' - } - } - - stage('status-go') { - steps { - sh 'make status-go' - } - } - - stage('build') { - environment { - GANACHE_NETWORK_RPC_URL = "http://localhost:${env.GANACHE_RPC_PORT}" - } - steps { - sh 'make' - } - } - - stage('Containers') { - parallel { - stage('Ganache') { steps { script { - ganache = docker.image( - 'trufflesuite/ganache:v7.4.1' - ).run( - ["-p 127.0.0.1:${env.GANACHE_RPC_PORT}:8545", - "-v ${env.WORKSPACE}/test/ui-test/fixtures/ganache-dbs/goerli:/goerli-db"].join(' '), - ["-m='${GANACHE_MNEMONIC}'", "-e=10", - '--chain.chainId=5', - '--database.dbPath=/goerli-db'].join(' ') - ) - } } } - - stage('Nim-Waku') { steps { script { - nimwaku = docker.image( - 'statusteam/nim-waku:v0.13.0' - ).run( - ["-p 127.0.0.1:${env.RPC_PORT}:8545", - "-p 127.0.0.1:${env.P2P_PORT}:30303/tcp", - "-p 127.0.0.1:${env.P2P_PORT}:30303/udp", - "-v ${env.WORKSPACE}/ci/mailserver/config.json:/config.json"].join(' '), - ['--store=true', - '--keep-alive=true', - '--rpc-address=0.0.0.0', - '--nat=none'].join(' ') - ) - env.TEST_PEER_ENR = getPeerAddress() - } } } - } - } - - stage('Tests') { - options { - throttle(categories: ['status-desktop-e2e-tests']) - } - steps { script { - wrap([ - $class: 'Xvfb', - autoDisplayName: true, - parallelBuild: true, - screen: '2560x1440x24', - ]) { script { - def result = squish([ - extraOptions: [ - '--retry', '2', - '--tags', '~mayfail', - '--tags', '~merge', - '--tags', '~relyon-mailserver', - '--config', 'addAUT', 'nim_status_client', - "${WORKSPACE}/bin", - ].join('\n'), - squishPackageName: 'squish-6.7.2-qt514x-linux64', - testSuite: "${WORKSPACE}/test/ui-test/testSuites/*", - ]) - print("Squish run result: ${result}") - /* Ignore UNSTABLE caused by retried tests. */ - if (!['SUCCESS', 'UNSTABLE'].contains(result)) { - throw new Exception('Squish run failed!') - } - } } - } } - post { - failure { script { - sh("docker logs ${nimwaku.id}") - sh("docker logs ${ganache.id}") - } } - } - } - } - - post { - success { script { - github.notifyPR(true) - } } - failure { script { - github.notifyPR(false) - } } - always { script { /* No artifact but a PKG_URL is necessary. */ - env.PKG_URL = "${currentBuild.absoluteUrl}/consoleText" - } } - cleanup { script { - sh './scripts/clean-git.sh' - if (binding.hasVariable('ganache')) { ganache.stop() } - if (binding.hasVariable('nimwaku')) { nimwaku.stop() } - } } - } -} - -def getPeerAddress() { - def rpcResp = sh( - script: "${env.WORKSPACE}/scripts/rpc.sh get_waku_v2_debug_v1_info", - returnStdout: true - ).trim() - assert rpcResp : 'Could not get node address from RPC API!' - return readJSON(text: rpcResp)['result']['listenAddresses'][0] -} diff --git a/ci/Jenkinsfile.imports b/ci/Jenkinsfile.imports deleted file mode 100644 index e0c55a4ebfd..00000000000 --- a/ci/Jenkinsfile.imports +++ /dev/null @@ -1,66 +0,0 @@ -library 'status-jenkins-lib@v1.6.3' - -/* Options section can't access functions in objects. */ -def isPRBuild = utils.isPRBuild() - -pipeline { - agent { label 'linux' } - - parameters { - choice( - name: 'VERBOSE', - description: 'Level of verbosity based on nimbus-build-system setup.', - choices: ['0', '1', '2'] - ) - } - - options { - timestamps() - /* Prevent Jenkins jobs from running forever */ - timeout(time: 120, unit: 'MINUTES') - /* manage how many builds we keep */ - buildDiscarder(logRotator( - numToKeepStr: '10', - daysToKeepStr: '30', - artifactNumToKeepStr: '3', - )) - /* Abort old PR builds. */ - disableConcurrentBuilds( - abortPrevious: isPRBuild - ) - } - - environment { - TARGET = 'imports' - /* Improve make performance */ - MAKEFLAGS = "-j4 V=${params.VERBOSE}" - /* Disable colors in Nim compiler logs */ - NIMFLAGS = '--colors:off' - /* Makefile assumes the compiler folder is included */ - QTDIR = "/opt/qt/5.14.2/gcc_64" - /* Include library in order to compile the project */ - LD_LIBRARY_PATH = "$QTDIR/lib:$WORKSPACE/vendor/status-go/build/bin:$WORKSPACE/vendor/status-keycard-go/build/libkeycard/" - } - - stages { - stage('Build') { - steps { sh 'make statusq-sanity-checker' } - } - - stage('Check') { - steps { sh 'make run-statusq-sanity-checker' } - } - - stage('Upload') { - steps { script { - env.PKG_URL = "${currentBuild.absoluteUrl}/consoleText" - } } - } - } - - post { - success { script { github.notifyPR(true) } } - failure { script { github.notifyPR(false) } } - cleanup { cleanWs() } - } -} diff --git a/ci/Jenkinsfile.linux b/ci/Jenkinsfile.linux index 24e4a2bcb4b..5972b9b5c8b 100644 --- a/ci/Jenkinsfile.linux +++ b/ci/Jenkinsfile.linux @@ -1,16 +1,11 @@ -library 'status-jenkins-lib@v1.6.3' +library 'status-jenkins-lib@linux-use-nix' /* Options section can't access functions in objects. */ def isPRBuild = utils.isPRBuild() pipeline { agent { - docker { - label 'linux' - image 'statusteam/nim-status-client-build:1.1.5' - /* allows jenkins use cat and mounts '/dev/fuse' for linuxdeployqt */ - args '--entrypoint="" --cap-add SYS_ADMIN --security-opt apparmor:unconfined --device /dev/fuse' - } + label 'linux' } parameters { @@ -48,8 +43,6 @@ pipeline { MAKEFLAGS = "-j4 V=${params.VERBOSE}" /* Disable colors in Nim compiler logs */ NIMFLAGS = '--colors:off' - /* Makefile assumes the compiler folder is included */ - QTDIR = "/opt/qt/5.14.0/gcc_64" /* Control output the filename */ STATUS_CLIENT_APPIMAGE = "pkg/${utils.pkgFilename(ext: 'AppImage')}" STATUS_CLIENT_TARBALL = "pkg/${utils.pkgFilename(ext: 'tar.gz')}" @@ -57,16 +50,16 @@ pipeline { stages { stage('Deps') { - steps { - sh 'make update' - sh 'make deps' - } + steps { script { + nix.shell('make update', pure: false) + nix.shell('make deps', pure: false) + } } } stage('status-go') { - steps { - sh 'make status-go' - } + steps { script { + nix.shell('make status-go', pure: false) + } } } stage('Package') { diff --git a/ci/Jenkinsfile.linux-cpp b/ci/Jenkinsfile.linux-cpp deleted file mode 100644 index 4a2a13d5cce..00000000000 --- a/ci/Jenkinsfile.linux-cpp +++ /dev/null @@ -1,90 +0,0 @@ -library 'status-jenkins-lib@v1.6.3' - -/* Options section can't access functions in objects. */ -def isPRBuild = utils.isPRBuild() - -pipeline { - agent { - dockerfile { - label 'linux' - dir 'ci/cpp' - filename 'Dockerfile-linux' - /* allows jenkins use cat and mounts '/dev/fuse' for linuxdeployqt */ - args '--entrypoint="" --cap-add SYS_ADMIN --security-opt apparmor:unconfined --device /dev/fuse' - } - } - - parameters { - booleanParam( - name: 'RELEASE', - description: 'Decides whether binaries are built with debug symbols.', - defaultValue: params.RELEASE ?: false - ) - } - - options { - timestamps() - /* Prevent Jenkins jobs from running forever */ - timeout(time: 20, unit: 'MINUTES') - /* manage how many builds we keep */ - buildDiscarder(logRotator( - numToKeepStr: '10', - daysToKeepStr: '30', - artifactNumToKeepStr: '3', - )) - /* Abort old PR builds. */ - disableConcurrentBuilds( - abortPrevious: isPRBuild - ) - } - - environment { - TARGET = 'linux-cpp' - /* Control output the filename */ - STATUS_CLIENT_APPIMAGE = "pkg/${utils.pkgFilename(ext: 'AppImage')}" - CONAN_USER_HOME = "${env.WORKSPACE}/build/conan/conan_home" - CONAN_NON_INTERACTIVE = 1 - } - - // TODO: Move all stages to the Makefile as targets "*-linux-using-docker" - stages { - stage('CMake Build') { - steps { - sh "conan install ${env.WORKSPACE}/ --profile=${env.WORKSPACE}/vendor/conan-configs/linux.ini -s build_type=Release --build=missing -if=${env.WORKSPACE}/build/conan -of=${env.WORKSPACE}/build" - // TODO: This fails compiling status-go with Jenkins user but not when run with docker's user. Fix go installation to work for all users or build docker with jenkin's - sh "CC=gcc-10 CXX=g++-10 qt-cmake ${env.WORKSPACE}/ -G Ninja -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=${env.WORKSPACE}/build/conan/conan_toolchain.cmake" - sh "cmake --build ${env.WORKSPACE}/build" - } - } - - // stage('Run Tests') { - // steps { - // sh "CTEST_OUTPUT_ON_FAILURE=1 QT_QPA_PLATFORM=offscreen ctest --test-dir ${env.WORKSPACE}/build" - // } - // } - - stage('Package') { - steps { - sh "linuxdeploy --plugin qt --executable=${env.WORKSPACE}/build/status-desktop --appdir ${env.WORKSPACE}/build/AppDir --desktop-file=${env.WORKSPACE}/status.desktop --icon-file=${env.WORKSPACE}/status.svg --custom-apprun=${env.WORKSPACE}/AppRun-cpp" - sh "cmake --install ${env.WORKSPACE}/build --prefix=${env.WORKSPACE}/build/install" - sh "cp ${env.WORKSPACE}/build/install/lib/* ${env.WORKSPACE}/build/AppDir/usr/lib/" - // TODO enable after deploying appimage plugin in the corresponding docker - //sh "linuxdeploy --appdir ${env.WORKSPACE}/build/AppDir --output=appimage" - // sh "mkdir pkg && cp \"\$(find ${env.WORKSPACE}/build/AppDir -maxdepth 2 -type f -iname \"*.AppImage\")\" ${env.STATUS_CLIENT_APPIMAGE}" - } - } - - stage('Upload') { - steps { script { - /* TODO: Enable after generating the AppImage. */ - env.PKG_URL = "${currentBuild.absoluteUrl}/consoleText" - } } - } - } - - post { - success { script { github.notifyPR(true) } } - failure { script { github.notifyPR(false) } } - cleanup { sh './scripts/clean-git.sh' } - } -} diff --git a/ci/Jenkinsfile.macos b/ci/Jenkinsfile.macos deleted file mode 100644 index 2a5c86e4f25..00000000000 --- a/ci/Jenkinsfile.macos +++ /dev/null @@ -1,111 +0,0 @@ -library 'status-jenkins-lib@v1.6.3' - -/* Options section can't access functions in objects. */ -def isPRBuild = utils.isPRBuild() - -pipeline { - agent { - label 'macos && x86_64' - } - - parameters { - booleanParam( - name: 'RELEASE', - description: 'Decides whether binaries are built with debug symbols.', - defaultValue: params.RELEASE ?: false - ) - choice( - name: 'VERBOSE', - description: 'Level of verbosity based on nimbus-build-system setup.', - choices: ['0', '1', '2'] - ) - } - - options { - timestamps() - /* Prevent Jenkins jobs from running forever */ - timeout(time: 25, unit: 'MINUTES') - /* manage how many builds we keep */ - buildDiscarder(logRotator( - numToKeepStr: '10', - daysToKeepStr: '30', - artifactNumToKeepStr: '3', - )) - /* Abort old PR builds. */ - disableConcurrentBuilds( - abortPrevious: isPRBuild - ) - } - - environment { - TARGET = 'macos' - /* Improve make performance */ - MAKEFLAGS = "-j4 V=${params.VERBOSE}" - /* Disable colors in Nim compiler logs */ - NIMFLAGS = '--colors:off' - /* Qt location is pre-defined */ - QTDIR = '/usr/local/qt/clang_64' - PATH = "${env.QTDIR}/bin:${env.PATH}" - /* Control output the filename */ - STATUS_CLIENT_DMG = "pkg/${utils.pkgFilename(ext: 'dmg')}" - /* Apple Team ID for Notarization */ - MACOS_NOTARIZE_TEAM_ID = "8B5X2M6H2Y" - } - - stages { - stage('Deps') { - steps { - sh 'make update' - withCredentials([ - usernamePassword( /* For fetching HomeBrew bottles. */ - credentialsId: "status-im-auto-pkgs", - usernameVariable: 'GITHUB_USER', - passwordVariable: 'GITHUB_TOKEN' - ) - ]) { - sh 'make deps' - } - } - } - - stage('status-go') { - steps { - sh 'make status-go' - } - } - - stage('Package') { - steps { script { - macos.bundle('pkg-macos') - } } - } - - stage('Notarize') { - when { expression { utils.isReleaseBuild() } } - steps { script { - macos.notarize() - } } - } - - stage('Parallel Upload') { - parallel { - stage('Upload') { - steps { script { - env.PKG_URL = s3.uploadArtifact(env.STATUS_CLIENT_DMG) - jenkins.setBuildDesc(Dmg: env.PKG_URL) - } } - } - stage('Archive') { - steps { script { - archiveArtifacts(env.STATUS_CLIENT_DMG) - } } - } - } - } - } - post { - success { script { github.notifyPR(true) } } - failure { script { github.notifyPR(false) } } - cleanup { sh './scripts/clean-git.sh' } - } -} diff --git a/ci/Jenkinsfile.macos-cpp.todo b/ci/Jenkinsfile.macos-cpp.todo deleted file mode 100644 index 008fc926443..00000000000 --- a/ci/Jenkinsfile.macos-cpp.todo +++ /dev/null @@ -1,82 +0,0 @@ -library 'status-jenkins-lib@v1.6.3' - -/* Options section can't access functions in objects. */ -def isPRBuild = utils.isPRBuild() - -pipeline { - agent { - docker { - label 'linux' - image 'stateoftheartio/qt6:6.3-macos-aqt' - } - } - - parameters { - booleanParam( - name: 'RELEASE', - description: 'Decides whether binaries are built with debug symbols.', - defaultValue: params.RELEASE ?: false - ) - } - - options { - timestamps() - /* Prevent Jenkins jobs from running forever */ - timeout(time: 20, unit: 'MINUTES') - /* manage how many builds we keep */ - buildDiscarder(logRotator( - numToKeepStr: '10', - daysToKeepStr: '30', - artifactNumToKeepStr: '3', - )) - /* Abort old PR builds. */ - disableConcurrentBuilds( - abortPrevious: isPRBuild - ) - } - - environment { - TARGET = 'macos-cpp' - /* Control output the filename */ - STATUS_CLIENT_DMG = "pkg/${utils.pkgFilename(ext: 'dmg')}" - } - - // TODO: Move all stages to the Makefile as targets "*-mac-using-docker" - stages { - stage('CMake Build') { - steps { - sh "qt-cmake ${env.WORKSPACE} -G Ninja -B ${env.WORKSPACE}/build -DCMAKE_BUILD_TYPE=Release" - sh "cmake --build ${env.WORKSPACE}/build" - } - } - - stage('Package') { - steps { - sh "macdeployqt ${env.WORKSPACE}/build/*.app -verbose=1 -dmg -qmldir=${env.WORKSPACE}" - sh "mkdir pkg && cp \"\$(find ${env.WORKSPACE}/build -maxdepth 2 -type f -iname \"*.dmg\")\" ${env.STATUS_CLIENT_DMG}" - } - } - - stage('Parallel Upload') { - parallel { - stage('Upload') { - steps { script { - env.PKG_URL = s3.uploadArtifact(env.STATUS_CLIENT_DMG) - jenkins.setBuildDesc(Dmg: env.PKG_URL) - } } - } - stage('Archive') { - steps { script { - archiveArtifacts(env.STATUS_CLIENT_DMG) - } } - } - } - } - } - - post { - success { script { github.notifyPR(true) } } - failure { script { github.notifyPR(false) } } - cleanup { sh './scripts/clean-git.sh' } - } -} diff --git a/ci/Jenkinsfile.tests-nim b/ci/Jenkinsfile.tests-nim deleted file mode 100644 index b93c3a82f75..00000000000 --- a/ci/Jenkinsfile.tests-nim +++ /dev/null @@ -1,69 +0,0 @@ -library 'status-jenkins-lib@v1.6.3' - -/* Options section can't access functions in objects. */ -def isPRBuild = utils.isPRBuild() - -pipeline { - agent { - docker { - label 'linux' - image 'statusteam/nim-status-client-build:1.1.5' - } - } - - parameters { - choice( - name: 'VERBOSE', - description: 'Level of verbosity based on nimbus-build-system setup.', - choices: ['0', '1', '2'] - ) - } - - options { - timestamps() - /* Prevent Jenkins jobs from running forever */ - timeout(time: 20, unit: 'MINUTES') - /* manage how many builds we keep */ - buildDiscarder(logRotator( - numToKeepStr: '10', - daysToKeepStr: '30', - artifactNumToKeepStr: '3', - )) - /* Abort old PR builds. */ - disableConcurrentBuilds( - abortPrevious: isPRBuild - ) - } - - environment { - TARGET = 'tests-nim' - /* Improve make performance */ - MAKEFLAGS = "-j4 V=${params.VERBOSE}" - /* Disable colors in Nim compiler logs */ - NIMFLAGS = '--colors:off' - /* Makefile assumes the compiler folder is included */ - QTDIR = "/opt/qt/5.14.2/gcc_64" - /* Include library in order to compile the project */ - LD_LIBRARY_PATH = "$QTDIR/lib" - } - - stages { - stage('Deps') { - steps { - sh 'make update' - sh 'make deps' - } - } - - stage('Tests') { - steps { sh 'make tests-nim-linux' } - } - } - - post { - success { script { github.notifyPR(true) } } - failure { script { github.notifyPR(false) } } - always { script { env.PKG_URL = "${currentBuild.absoluteUrl}/consoleText" } } - cleanup { cleanWs() } - } -} diff --git a/ci/Jenkinsfile.windows b/ci/Jenkinsfile.windows deleted file mode 100644 index aa22df0ebb8..00000000000 --- a/ci/Jenkinsfile.windows +++ /dev/null @@ -1,102 +0,0 @@ -library 'status-jenkins-lib@v1.6.3' - -/* Options section can't access functions in objects. */ -def isPRBuild = utils.isPRBuild() - -pipeline { - agent { label 'windows' } - - parameters { - booleanParam( - name: 'RELEASE', - description: 'Decides whether binaries are built with debug symbols.', - defaultValue: params.RELEASE ?: false - ) - choice( - name: 'VERBOSE', - description: 'Level of verbosity based on nimbus-build-system setup.', - choices: ['0', '1', '2'] - ) - } - - options { - timestamps() - /* Prevent Jenkins jobs from running forever */ - timeout(time: 60, unit: 'MINUTES') - /* manage how many builds we keep */ - buildDiscarder(logRotator( - numToKeepStr: '10', - daysToKeepStr: '30', - artifactNumToKeepStr: '3', - )) - /* Abort old PR builds. */ - disableConcurrentBuilds( - abortPrevious: isPRBuild - ) - } - - environment { - TARGET = 'windows' - /* Improve make performance */ - MAKEFLAGS = "-j${utils.getProcCount()} V=${params.VERBOSE}" - /* Disable colors in Nim compiler logs */ - NIMFLAGS = '--colors:off' - /* Control output the filename */ - STATUS_CLIENT_EXE = "pkg/${utils.pkgFilename(ext: 'exe')}" - /* 7zip archive filename */ - STATUS_CLIENT_7Z = "pkg/${utils.pkgFilename(ext: '7z')}" - /* RFC 3161 timestamping URL for DigiCert */ - WINDOWS_CODESIGN_TIMESTAMP_URL = 'http://timestamp.digicert.com' - } - - stages { - stage('Deps') { - steps { - sh 'make update' - sh 'make deps' - } - } - - stage('status-go') { - steps { - sh 'make status-go' - } - } - - stage('Package') { - steps { script { - windows.bundle("${env.STATUS_CLIENT_EXE} ${env.STATUS_CLIENT_7Z}") - } } - } - - stage('Parallel Upload') { - /* Uploads on Windows are slow. */ - parallel { - stage('Upload 7Z') { - steps { script { - zip_url = s3.uploadArtifact(env.STATUS_CLIENT_7Z) - } } - } - stage('Upload EXE') { - steps { script { - exe_url = s3.uploadArtifact(env.STATUS_CLIENT_EXE) - } } - } - } - } - - stage('Archive') { - steps { script { - archiveArtifacts(env.STATUS_CLIENT_EXE) - archiveArtifacts(env.STATUS_CLIENT_7Z) - env.PKG_URL = exe_url - jenkins.setBuildDesc(Zip: zip_url, Exe: exe_url) - } } - } - } - post { - success { script { github.notifyPR(true) } } - failure { script { github.notifyPR(false) } } - cleanup { sh './scripts/clean-git.sh' } - } -} diff --git a/ci/Jenkinsfile.windows-cpp.todo b/ci/Jenkinsfile.windows-cpp.todo deleted file mode 100644 index 452e8d6440b..00000000000 --- a/ci/Jenkinsfile.windows-cpp.todo +++ /dev/null @@ -1,83 +0,0 @@ -library 'status-jenkins-lib@v1.6.3' - -/* Options section can't access functions in objects. */ -def isPRBuild = utils.isPRBuild() - -pipeline { - agent { - docker { - label 'linux' - image 'stateoftheartio/qt6:6.3-mingw-aqt' - } - } - - parameters { - booleanParam( - name: 'RELEASE', - description: 'Decides whether binaries are built with debug symbols.', - defaultValue: params.RELEASE ?: false - ) - } - - options { - timestamps() - /* Prevent Jenkins jobs from running forever */ - timeout(time: 20, unit: 'MINUTES') - /* manage how many builds we keep */ - buildDiscarder(logRotator( - numToKeepStr: '10', - daysToKeepStr: '30', - artifactNumToKeepStr: '3', - )) - /* Abort old PR builds. */ - disableConcurrentBuilds( - abortPrevious: isPRBuild - ) - } - - environment { - TARGET = 'windows-cpp' - /* Control output the filename */ - STATUS_CLIENT_ZIP = "pkg/${utils.pkgFilename(ext: 'zip')}" - } - - // TODO: Move all stages to the Makefile as targets "*-windows-using-docker" - stages { - stage('CMake Build') { - steps { - sh "qt-cmake ${env.WORKSPACE} -G Ninja -B ${env.WORKSPACE}/build -DCMAKE_BUILD_TYPE=Release" - sh "cmake --build ${env.WORKSPACE}/build" - } - } - - stage('Package') { - steps { - sh "windeployqt --qmldir ${env.WORKSPACE} --dir ${env.WORKSPACE}/build/deploy --libdir ${env.WORKSPACE}/build/deploy/libs --plugindir ${env.WORKSPACE}/build/deploy/plugins ${env.WORKSPACE}/build/*.exe" - sh "zip -r ${STATUS_CLIENT_ZIP} build/deploy/" - } - } - - stage('Parallel Upload') { - parallel { - stage('Upload') { - steps { script { - exe_url = s3.uploadArtifact(env.STATUS_CLIENT_ZIP) - env.PKG_URL = exe_url - jenkins.setBuildDesc(Zip: zip_url, Exe: exe_url) - } } - } - stage('Archive') { - steps { script { - archiveArtifacts(env.STATUS_CLIENT_ZIP) - } } - } - } - } - } - - post { - success { script { github.notifyPR(true) } } - failure { script { github.notifyPR(false) } } - cleanup { sh './scripts/clean-git.sh' } - } -}