Skip to content

Commit

Permalink
ci: only run deb installer on master
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Bandeira <[email protected]>
  • Loading branch information
Vitor Bandeira committed Nov 22, 2024
1 parent 6bc8226 commit edfac6e
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -188,34 +188,36 @@ def getParallelTests(String image) {

];

deb_os = [
[name: 'Ubuntu 20.04' , artifact_name: 'ubuntu-20.04', image: 'openroad/ubuntu20.04-dev'],
[name: 'Ubuntu 22.04' , artifact_name: 'ubuntu-22.04', image: 'openroad/ubuntu22.04-dev'],
[name: 'Debian 11' , artifact_name: 'debian11', image: 'openroad/debian11-dev']
];
deb_os.each { os ->
ret["Build .deb - ${os.name}"] = {
node {
stage('Setup and Build') {
sh label: 'Pull latest image', script: "docker pull ${os.image}:latest";
withDockerContainer(args: '-u root', image: "${os.image}") {
sh label: 'Configure git', script: "git config --system --add safe.directory '*'";
checkout([
$class: 'GitSCM',
branches: [[name: scm.branches[0].name]],
doGenerateSubmoduleConfigurations: false,
extensions: [
[$class: 'CloneOption', noTags: false],
[$class: 'SubmoduleOption', recursiveSubmodules: true]
],
submoduleCfg: [],
userRemoteConfigs: scm.userRemoteConfigs
]);
def version = sh(script: 'git describe | sed s,^v,,', returnStdout: true).trim();
sh label: 'Create Changelog', script: "./debian/create-changelog.sh ${version}";
sh label: 'Run debuild', script: 'debuild --preserve-env --preserve-envvar=PATH -B -j$(nproc)';
sh label: 'Move generated files', script: "./debian/move-artifacts.sh ${version} ${os.artifact_name}";
archiveArtifacts artifacts: '*' + "${version}" + '*';
if (env.BRANCH_NAME == 'master') {
deb_os = [
[name: 'Ubuntu 20.04' , artifact_name: 'ubuntu-20.04', image: 'openroad/ubuntu20.04-dev'],
[name: 'Ubuntu 22.04' , artifact_name: 'ubuntu-22.04', image: 'openroad/ubuntu22.04-dev'],
[name: 'Debian 11' , artifact_name: 'debian11', image: 'openroad/debian11-dev']
];
deb_os.each { os ->
ret["Build .deb - ${os.name}"] = {
node {
stage('Setup and Build') {
sh label: 'Pull latest image', script: "docker pull ${os.image}:latest";
withDockerContainer(args: '-u root', image: "${os.image}") {
sh label: 'Configure git', script: "git config --system --add safe.directory '*'";
checkout([
$class: 'GitSCM',
branches: [[name: scm.branches[0].name]],
doGenerateSubmoduleConfigurations: false,
extensions: [
[$class: 'CloneOption', noTags: false],
[$class: 'SubmoduleOption', recursiveSubmodules: true]
],
submoduleCfg: [],
userRemoteConfigs: scm.userRemoteConfigs
]);
def version = sh(script: 'git describe | sed s,^v,,', returnStdout: true).trim();
sh label: 'Create Changelog', script: "./debian/create-changelog.sh ${version}";
sh label: 'Run debuild', script: 'debuild --preserve-env --preserve-envvar=PATH -B -j$(nproc)';
sh label: 'Move generated files', script: "./debian/move-artifacts.sh ${version} ${os.artifact_name}";
archiveArtifacts artifacts: '*' + "${version}" + '*';
}
}
}
}
Expand Down

0 comments on commit edfac6e

Please sign in to comment.