-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e1eaa5
commit c1b678b
Showing
209 changed files
with
4,504 additions
and
2,358 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,175 @@ | ||
// This file is part of the HörTech Open Master Hearing Aid (openMHA) | ||
// Copyright © 2018 2019 HörTech gGmbH | ||
// | ||
// openMHA is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as published by | ||
// the Free Software Foundation, version 3 of the License. | ||
// | ||
// openMHA is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License, version 3 for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License, | ||
// version 3 along with openMHA. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
// Encapsulation of the build steps to perform when compiling openMHA | ||
// @param stage_name the stage name is "system && arch" where system is bionic, | ||
// xenial, trusty, windows, or mac, and arch is x86_64, i686, | ||
// or armv7. Both are separated by an && operator and spaces. | ||
// This string is also used as a valid label expression for | ||
// jenkins. The appropriate nodes have the respective labels. | ||
// We might need to extend this in future to include the | ||
// "mhadev" label, to differentiate build environments | ||
// for the same system and architecture but with different | ||
// library / tool dependencies. | ||
def openmha_build_steps(stage_name) { | ||
// Extract components from stage_name: | ||
def system, arch, devenv | ||
(system,arch,devenv) = stage_name.split(/ *&& */) // regexp for missing/extra spaces | ||
|
||
// Compilation on ARM is the slowest, assign 5 CPU cores to each ARM build job | ||
def cpus = (arch == "armv7") ? 5 : 1 | ||
|
||
// checkout and clean openMHA, branch development | ||
checkout changelog: false, poll: false, scm: [ | ||
$class: 'GitSCM', | ||
branches: [[name: "phabricator/diff/$DIFF_ID"]], | ||
browser: [$class: 'Phabricator', repo: 'rOMD', | ||
repoUrl: 'https://dev.openmha.org/'], | ||
doGenerateSubmoduleConfigurations: false, | ||
extensions: [[$class: 'CleanCheckout']], | ||
submoduleCfg: [], | ||
userRemoteConfigs: [[credentialsId: '8219f3dc-c16a-44d4-a0a3-a336b036fc29', | ||
url: "$GIT_SERVER_MHA/mha_phabricator_staging"]]] | ||
|
||
// Save time by using precompiled external libs if possible. | ||
// Install pre-compiled external libraries for the common branches | ||
copyArtifacts(projectName: "openMHA/external_libs/external_libs_development", | ||
selector: lastSuccessful()) | ||
sh "tar xvzf external_libs.tgz" | ||
|
||
// if we notice any differences between the sources of the precompiled | ||
// dependencies and the current sources, we cannot help but need to recompile | ||
sh "git diff --exit-code || (git reset --hard && git clean -ffdx)" | ||
|
||
// Autodetect libs/compiler | ||
sh "./configure" | ||
|
||
// On linux, we also create debian packages | ||
def linux = (system != "windows" && system != "mac") | ||
def windows = (system == "windows") | ||
def mac = (system == "mac") | ||
def debs = linux ? " deb" : "" | ||
def pkgs = mac ? " pkg" : "" | ||
def exes = windows ? " exe" : "" | ||
sh ("make -j $cpus install unit-tests" + debs + exes + pkgs) | ||
|
||
// The system tests perform timing measurements which may fail when | ||
// system load is high. Retry in that case, up to 2 times. | ||
retry(3){sh "make -C mha/mhatest"} | ||
|
||
if (linux) { | ||
// Store debian packets for later retrieval by the repository manager | ||
stash name: (arch+"_"+system), includes: 'mha/tools/packaging/deb/hoertech/' | ||
} | ||
|
||
if (windows) { | ||
// Store windows installer packets for later retrieval by the repository manager | ||
stash name: (arch+"_"+system), includes: 'mha/tools/packaging/exe/*.exe' | ||
} | ||
|
||
if (mac) { | ||
// Store mac installer packets for later retrieval by the repository manager | ||
stash name: (arch+"_"+system), includes: 'mha/tools/packaging/pkg/*.pkg' | ||
} | ||
} | ||
|
||
pipeline { | ||
agent {label "jenkinsmaster"} | ||
parameters { | ||
string(name: 'PHID', defaultValue: 'invalidDefault', description: '') | ||
string(name: 'DIFF_ID', defaultValue: 'invalidDefault', description: '') | ||
} | ||
stages { | ||
stage("build") { | ||
parallel { | ||
stage( "bionic && x86_64 && mhadev") { | ||
agent {label "bionic && x86_64 && mhadev"} | ||
steps {openmha_build_steps("bionic && x86_64 && mhadev")} | ||
} | ||
stage( "xenial && x86_64 && mhadev") { | ||
agent {label "xenial && x86_64 && mhadev"} | ||
steps {openmha_build_steps("xenial && x86_64 && mhadev")} | ||
} | ||
stage( "trusty && x86_64 && mhadev") { | ||
agent {label "trusty && x86_64 && mhadev"} | ||
steps {openmha_build_steps("trusty && x86_64 && mhadev")} | ||
} | ||
// We can also build for 32 bits. Deactivated to save | ||
// CPU cycles on Jenkins server. | ||
// stage( "bionic && i686") { | ||
// agent {label "bionic && i686"} | ||
// steps {openmha_build_steps("bionic && i686")} | ||
// } | ||
// stage( "xenial && i686") { | ||
// agent {label "xenial && i686"} | ||
// steps {openmha_build_steps("xenial && i686")} | ||
// } | ||
// stage( "trusty && i686") { | ||
// agent {label "trusty && i686"} | ||
// steps {openmha_build_steps("trusty && i686")} | ||
// } | ||
stage( "bionic && armv7 && mhadev") { | ||
agent {label "bionic && armv7 && mhadev"} | ||
steps {openmha_build_steps("bionic && armv7 && mhadev")} | ||
} | ||
stage( "xenial && armv7 && mhadev") { | ||
agent {label "xenial && armv7 && mhadev"} | ||
steps {openmha_build_steps("xenial && armv7 && mhadev")} | ||
} | ||
stage( "windows && x86_64 && mhadev") { | ||
agent {label "windows && x86_64 && mhadev"} | ||
steps {openmha_build_steps("windows && x86_64 && mhadev")} | ||
} | ||
stage( "mac && x86_64 && mhadev") { | ||
agent {label "mac && x86_64 && mhadev"} | ||
steps {openmha_build_steps("mac && x86_64 && mhadev")} | ||
} | ||
} | ||
} | ||
stage("artifacts") { | ||
steps { | ||
// Publish mac installer as a Jenkins artifact | ||
unstash "x86_64_mac" | ||
archiveArtifacts 'mha/tools/packaging/pkg/*.pkg' | ||
|
||
// Publish windows installer as a Jenkins artifact | ||
unstash "x86_64_windows" | ||
archiveArtifacts 'mha/tools/packaging/exe/*.exe' | ||
|
||
// Publish debian packages as Jenkins artifacts | ||
unstash "x86_64_bionic" | ||
unstash "x86_64_xenial" | ||
unstash "x86_64_trusty" | ||
unstash "armv7_bionic" | ||
unstash "armv7_xenial" | ||
archiveArtifacts 'mha/tools/packaging/deb/hoertech/*/*.deb' | ||
} | ||
} | ||
} | ||
post { | ||
always { | ||
script { | ||
// workaround. See https://github.com/uber/phabricator-jenkins-plugin/pull/185 | ||
currentBuild.result = currentBuild.currentResult | ||
} | ||
step([$class: 'PhabricatorNotifier', | ||
commentOnSuccess: true, | ||
commentWithConsoleLinkOnFailure: true, | ||
uberallsEnabled: false, | ||
customComment: false, | ||
processLint: false]) | ||
} | ||
} | ||
} |
Oops, something went wrong.