1 Star 0 Fork 1

kwin-workshop/extra-cmake-modules

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Jenkinsfile_master_kf5-qt5_linux_gcc 7.43 KB
一键复制 编辑 原始数据 按行查看 历史
openKylinBot 提交于 2022-05-16 15:59 +08:00 . Import Upstream version 5.92.0
#!groovy
/*
The MIT License
Copyright (c) 2015-, CloudBees, Inc., and a number of other of contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
node(linux) {
// We want Timestamps on everything
timestamps {
// First Thing: Checkout Sources
stage('Checkout Sources') {
// Actual Application Sources
checkout changelog: true, poll: true, scm: [
$class: 'GitSCM',
branches: [[name: ${branch}]],
browser: [$class: 'CGit', repoUrl: 'https://cgit.kde.org/extra-cmake-modules.git'],
extensions: [[$class: 'CloneOption', timeout: 120]],
userRemoteConfigs: [[url: 'https://anongit.kde.org/extra-cmake-modules.git']]
]
// Our CI scripts
checkout changelog: false, poll: false, scm: [
$class: 'GitSCM',
branches: [[name: 'master']],
extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'ci-tooling/']],
userRemoteConfigs: [[url: 'https://anongit.kde.org/sysadmin/ci-tools-experimental.git']]
]
// Dependency Metadata
checkout changelog: false, poll: false, scm: [
$class: 'GitSCM',
branches: [[name: 'master']],
extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'ci-tooling/dependencies/']],
userRemoteConfigs: [[url: 'https://anongit.kde.org/kde-build-metadata']]
]
// KApiDox: For api.kde.org metadata extraction
checkout changelog: false, poll: false, scm: [
$class: 'GitSCM',
branches: [[name: 'master']],
extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'ci-tooling/kapidox/']],
userRemoteConfigs: [[url: 'https://anongit.kde.org/kapidox']]
]
// kde-dev-scripts: For packager metadata extraction
checkout changelog: false, poll: false, scm: [
$class: 'GitSCM',
branches: [[name: 'master']],
extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'ci-tooling/kde-dev-scripts/']],
userRemoteConfigs: [[url: 'https://anongit.kde.org/kde-dev-scripts']]
]
}
// Now Prepare to Build: Get the dependencies ready
stage('Setup Dependencies') {
// Now we can determine what our dependencies are
// Then update to the latest version of the dependencies available from the master server
// Finally extract all of those dependencies in turn into the given 'installTo' directory
sh 'python helpers/prepare-dependencies.py --project extra-cmake-modules --branchGroup kf5-qt5 --platform linux --installTo + "$WORKSPACE/install-prefix/"
}
// Now we can configure our build
stage('Configuring Build') {
// This is delegated through a helper script to handle minor special cases like inSourceBuilds, non-CMake build systems, etc
sh 'python helpers/configure-build.py --project extra-cmake-modules --branchGroup kf5-qt5 --platform linux '--installTo + "$WORKSPACE/install-prefix/"
}
// Finally we can build it! (Once again, through a helper)
stage('Compiling') {
// We use a helper here so we can determine the appropriate number of CPUs (-j) to build with
sh 'python helpers/compile-build.py --project extra-cmake-modules --branchGroup kf5-qt5 --platform linux
}
// Now ensure that it installs....
stage('Installing') {
// The helper ensures that DESTDIR and INSTALL_ROOT are set to 'divertTo'
// This allows us to capture the install at the next stage for later reuse in the Setup Dependencies step
sh 'python helpers/install-build.py --project extra-cmake-modules --branchGroup kf5-qt5 --platform linux --divertTo + "$WORKSPACE/install-divert/"
}
// Looks like it built okay - let's capture this for later use
// We'll also take the opportunity to extract metadata from CMake used by packagers and api.kde.org
stage('Capturing Installation') {
// First we create a tar archive of the installation which was diverted
// Then we upload a copy of that to the master server and have it publish the new archive
// Finally to save bandwidth our copy of the tar archive is moved to our local cache for reuse on later builds on this node
sh 'python helpers/capture-install.py --project extra-cmake-modules --branchGroup kf5-qt5 --platform linux --divertedTo "$WORKSPACE/install-divert/" --installTo "$WORKSPACE/install-prefix/"
// Now we extract the CMake metadata and upload that to the appropriate hosts
sh 'python helpers/extract-cmake-metadata.py --project extra-cmake-modules --branchGroup kf5-qt5 --platform linux
}
// Now we can run our tests
stage('Running Tests') {
// Run the unit tests for this project
// Tests are run in a basic environment (X, DBus)
sh 'python helpers/run-tests.py --project extra-cmake-modules --branchGroup kf5-qt5 --platform linux
// Collect our results
junit allowEmptyResults: true, testResults: 'build/JUnitTestResults.xml'
}
// Final thing to do: some code quality checks
stage('Checking Code Quality') {
// cppcheck is not supported by Pipeline at the moment, so we don't run that for now
// See https://issues.jenkins-ci.org/browse/JENKINS-35096
// Cobertura doesn't support Pipeline either, so no code coverage publishing...
// See https://issues.jenkins-ci.org/browse/JENKINS-30700
// Scan the logs and publish a warnings report
step( [$class: 'WarningsPublisher', consoleParsers: [[parserName: 'GNU Make + GNU C Compiler (gcc)'], [parserName: 'Appstreamercli']], excludePattern: '/tmp/**'] )
}
// Send an email notification of this
emailext(
to: 'ci-builds@kde.org',
body: '${JELLY_SCRIPT,template="text"}',
subject: 'KDE CI: ${PROJECT_NAME} - Build # ${BUILD_NUMBER} - ${BUILD_STATUS}!',
attachLog: true
)
// IRC Notifications are currently not supported by Pipeline
// See https://issues.jenkins-ci.org/browse/JENKINS-33922
// We can probably workaround this using Pursuivant and the emails Jenkins sends out
// This would allow subscribing to build notifications for IRC channels in much the same way one subscribes for Commits and Bugzilla changes
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/kwin-workshop/extra-cmake-modules.git
git@gitee.com:kwin-workshop/extra-cmake-modules.git
kwin-workshop
extra-cmake-modules
extra-cmake-modules
openkylin/yangtze

搜索帮助