Skip to content

Commit

Permalink
ci: save deb artifacts with os name
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 ac5ec6f commit 6bc8226
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,10 @@ def getParallelTests(String image) {
];

deb_os = [
[name: 'Ubuntu 20.04' , image: 'openroad/ubuntu20.04-dev'],
[name: 'Ubuntu 22.04' , image: 'openroad/ubuntu22.04-dev'],
[name: 'Debian 11' , image: 'openroad/debian11-dev']
[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 {
Expand All @@ -215,7 +214,7 @@ def getParallelTests(String image) {
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}";
sh label: 'Move generated files', script: "./debian/move-artifacts.sh ${version} ${os.artifact_name}";
archiveArtifacts artifacts: '*' + "${version}" + '*';
}
}
Expand Down
6 changes: 3 additions & 3 deletions debian/move-artifacts.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/env bash

if [[ $# -ne 1 ]]; then
if [[ $# -ne 2 ]]; then
echo "Error: This script requires exactly one argument."
echo "usage: $0 <VERSION>"
echo "usage: $0 <VERSION> <OS_NAME>"
exit 1
fi

for file in ../*${1}*; do
base_name=$(basename "$file")
name="${base_name%.*}"
ext="${base_name##*.}"
mv "$file" "${name}-${os_name}.${ext}"
mv "$file" "${name}-${2}.${ext}"
done

0 comments on commit 6bc8226

Please sign in to comment.