Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
5481bce
feat(rear): blkid
BarysBarysenka Nov 13, 2025
1cf494a
feat(bm): Changed naming of rear tarball
krzysztof04 Nov 18, 2025
bec0c4a
feat(bm): Review fixes: fixed typo
krzysztof04 Nov 18, 2025
bf7fb88
feat(bm): Fixed CI build: changed 'grep -P' to 'sed'
krzysztof04 Nov 19, 2025
4ddfce9
feat(bm): Fixed output tarball names according to acceptance criteria
krzysztof04 Nov 24, 2025
6e374d3
Merge pull request #45 from nable-backup/feature/BCF-5671-add-blkid-t…
ashaulou Dec 3, 2025
21b3f68
feat(cove): upgrade Shim and GRUB on Debian 10
svlv Dec 3, 2025
baf9227
feat(cove): correct grammar errors
svlv Dec 3, 2025
d24e91e
feat(cove): correct file name
svlv Dec 3, 2025
0e4f156
feat(rear): unit tests
BarysBarysenka Dec 3, 2025
040feb9
Merge pull request #56 from nable-backup/feature/BCF-6186-run-unit-te…
NastyaKapskaya Dec 3, 2025
0824d2b
feat(rear): unit tests
BarysBarysenka Nov 27, 2025
2ed2543
Merge branch 'develop' into feature/BCF-6007-rear-debian-10-fails-to-…
svlv Dec 4, 2025
8c81006
feat(rear): unit tests
BarysBarysenka Dec 3, 2025
4070ad2
feat(cove): skip upgrading Shim and GRUB if SB disabled
svlv Dec 4, 2025
eeb5a2d
Merge pull request #54 from nable-backup/feature/BCF-6186-run-unit-te…
NastyaKapskaya Dec 4, 2025
b6cba5e
Merge branch 'develop' into feature/BCF-6007-rear-debian-10-fails-to-…
svlv Dec 4, 2025
8673edd
feat(bm): Fixed build for rpm package
krzysztof04 Dec 5, 2025
96b3f25
feat(cove): roll back logic related to SB status
svlv Dec 5, 2025
9cf5e10
Merge branch 'develop' into feature/BCF-5414-Adapt-build-scripts-for-…
krzysztof04 Dec 5, 2025
3012d90
feat(bm): Fixed issues after merge with develop
krzysztof04 Dec 5, 2025
47b41ef
feat(bm): Fixed issues after merge with develop
krzysztof04 Dec 5, 2025
343b05f
feat(cove): fix roll back
svlv Dec 5, 2025
425a505
feat(cove): cover case when grub or shim are missing
svlv Dec 5, 2025
d748c20
feat(rear): unit tests
BarysBarysenka Dec 5, 2025
d372914
Merge pull request #61 from nable-backup/feature/BCF-6186-run-unit-te…
BarysBarysenka Dec 8, 2025
a678ac9
feat(rear): unit tests
BarysBarysenka Dec 8, 2025
e75fbb4
Merge pull request #64 from nable-backup/feature/BCF-6186-unit-tests-…
ashaulou Dec 8, 2025
e4a8534
Merge pull request #57 from nable-backup/feature/BCF-5414-Adapt-build…
NastyaKapskaya Dec 9, 2025
ca5b793
Merge pull request #55 from nable-backup/feature/BCF-6007-rear-debian…
ashaulou Dec 12, 2025
d4bb4ee
feat(cove): determine EFI bootloader
svlv Dec 15, 2025
92947b5
feat(cove): fix review comments from Copilot
svlv Dec 17, 2025
de95aae
feat(cove): fix review comments from Copilot
svlv Dec 17, 2025
652dbf3
feat(cove): check bootloader path
svlv Dec 18, 2025
1c9af05
feat(cove): support File(...) format in bootloader path
svlv Dec 19, 2025
c89bdc3
Merge pull request #67 from nable-backup/feature/BCF-6232-after-bmr-e…
NastyaKapskaya Dec 22, 2025
48443f5
feat(rear): files hash
BarysBarysenka Dec 18, 2025
6909e84
feat(rear): compare hash hash
BarysBarysenka Jan 13, 2026
67f4ff9
Merge branch 'develop' into feature/BCF-6382-resolve-conflicts
svlv Jan 16, 2026
5bfcdda
Merge pull request #70 from nable-backup/feature/BCF-6382-resolve-con…
NastyaKapskaya Jan 16, 2026
3382487
Merge pull request #68 from nable-backup/feature/BCF-6278-check-files…
ashaulou Jan 16, 2026
6f52993
feat(rear): compare hash hash
BarysBarysenka Jan 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import nable.cove.helpers.ShellHelper
import nable.cove.SecretManager

final String jobName = env.JOB_NAME.split('/')[-2]
final String branchName = env.CHANGE_BRANCH ?: env.BRANCH_NAME
final String branchName = env.CHANGE_TARGET ?: env.BRANCH_NAME
final boolean isProd = jobName.endsWith('-prd')
final boolean isProdBranch = branchName == 'master' || branchName.startsWith('release')
final boolean isProdBranch = branchName == 'master'
final String envType = isProd ? 'prd' : 'dev'

def String repositoryName = 'rear'
Expand Down Expand Up @@ -55,8 +55,10 @@ pipeline {
steps {
script {
if (isProd != isProdBranch) {
echo "Environment mismatch: isProd=${isProd}, isProdBranch=${isProdBranch}. Skipping build."
echo "Environment mismatch: target branch is ${branchName}, job is ${jobName}. Skipping build."
shouldBuild = false
} else {
echo "Environment match: target branch is ${branchName}, job is ${jobName}. Proceeding with build."
}

secretManager = new SecretManager(
Expand Down
33 changes: 26 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# cp -a etc/rear/{mappings,templates} ...
# assumes bash. So its better to set SHELL to bash explicitly, using the one from PATH
# to also work on MacOS with Homebrew-installed bash
# test
SHELL = bash

# disable parallel execution of make
Expand Down Expand Up @@ -34,12 +35,22 @@ else
git_date := $(shell git log -n 1 --format="%ai")
git_ref := $(shell git rev-parse HEAD | cut -c 1-8)
git_count := $(shell git rev-list HEAD --no-merges | wc -l)
git_branch_suffix = $(shell echo "$${CHANGE_BRANCH:-$${BRANCH_NAME:-$$(git symbolic-ref HEAD || echo unknown)}}" | sed -e 's,^.*/,,' -e "s/[^A-Za-z0-9]//g")
git_branch_name = $(shell echo "$${CHANGE_BRANCH:-$${BRANCH_NAME:-$$(git symbolic-ref HEAD || echo unknown)}}")
git_branch_suffix = $(shell echo "$(git_branch_name)" | sed -e 's,^.*/,,' -e "s/[^A-Za-z0-9]//g")
cove_suffix = $(git_branch_suffix)
release_suffix = $(shell echo "$(git_branch_name)" | sed -nE 's/^.*?release\/([0-9.-]*-cove).*/\1/p')
ifneq ($(release_suffix),)
cove_suffix = $(release_suffix)
endif
feature_suffix = $(shell echo "$(git_branch_name)" | sed -nE 's/^.*?(feature|hotfix)\/([A-Za-z0-9_-]+-[0-9]+).*/\2/p')
ifneq ($(feature_suffix),)
cove_suffix = $(feature_suffix)
endif
git_status := $(shell git status --porcelain)
git_stamp := $(git_count).$(git_ref).$(git_branch_suffix)
ifneq ($(git_status),)
git_stamp := $(git_stamp).changed
endif # git_status
changed_suffix = .changed
endif
git_stamp := $(git_count).$(git_ref).$(git_branch_suffix)
else # no git
git_date := now
git_ref := 0
Expand All @@ -50,9 +61,17 @@ else
endif # has .git
git_stamp ?= 0.0.unknown

distversion = $(version)-git.$(git_stamp)
debrelease = 0git.$(git_stamp)
rpmrelease = .git.$(git_stamp)
ifneq ($(release_suffix),)
distversion = $(cove_suffix)$(changed_suffix)
else
ifneq ($(feature_suffix),)
distversion = $(version)-$(git_count).$(git_ref).$(cove_suffix)$(changed_suffix)
else # is not release version
distversion = $(version)-$(git_stamp)$(changed_suffix)
endif
endif # is release version
debrelease = 0git.$(git_stamp)$(changed_suffix)
rpmrelease = .git.$(git_stamp)$(changed_suffix)
obsproject = Archiving:Backup:Rear:Snapshot
obspackage = $(name)

Expand Down
2 changes: 2 additions & 0 deletions tests/COVE/000_save_future_dangling_efi_entries.bats
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bats

setup_file() {
export REAR_SHARE_DIR="$(realpath "$BATS_TEST_DIRNAME/../../usr/share/rear")"
export USING_UEFI_BOOTLOADER="yes"
Expand Down
2 changes: 2 additions & 0 deletions tests/COVE/001_remove_dangling_efi_entries.bats
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bats

setup_file() {
export REAR_SHARE_DIR="$(realpath "$BATS_TEST_DIRNAME/../../usr/share/rear")"
export USING_UEFI_BOOTLOADER="yes"
Expand Down
107 changes: 107 additions & 0 deletions tests/COVE/002_upgrade_bootloaders_on_debian10.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#!/usr/bin/env bats

#
# Unit tests for upgrading Shim and GRUB bootloaders on Debian 10
#

function setup_file() {
REAR_SHARE_DIR="$(realpath "$BATS_TEST_DIRNAME/../../usr/share/rear")"
export REAR_SHARE_DIR
}

function setup() {
# shellcheck disable=SC1091
source "$REAR_SHARE_DIR/lib/global-functions.sh"

function LogPrint() {
echo "$@"
}

OS_VERSION=10
USING_UEFI_BOOTLOADER=yes
function is_cove_in_azure() {
false
}
EFI_STUB=no
UEFI_BOOTLOADER=/boot/efi/EFI/debian/shimx64.efi
}

@test "Shim and GRUB are upgraded successfully" {
function upgrade_bootloaders() {
return 0
}

run source "$REAR_SHARE_DIR/finalize/COVE/Debian/620_upgrade_bootloaders.sh"
[ "$status" -eq 0 ]

local expected_output="Upgraded signed Shim and GRUB bootloaders for this system."
[ "$output" = "$expected_output" ]
}

@test "Failed to upgrade Shim and GRUB" {
function upgrade_bootloaders() {
return 1
}

run source "$REAR_SHARE_DIR/finalize/COVE/Debian/620_upgrade_bootloaders.sh"
[ "$status" -eq 0 ]

local expected_output="Failed to upgrade signed Shim and GRUB bootloaders for this system. UEFI Secure Boot might not be available."
[ "$output" = "$expected_output" ]
}

@test "Skip upgrading Shim and GRUB if the system is not Debian 10" {
# shellcheck disable=SC2034
OS_VERSION=11

run source "$REAR_SHARE_DIR/finalize/COVE/Debian/620_upgrade_bootloaders.sh"
[ "$status" -eq 0 ]

local expected_output=""
[ "$output" = "$expected_output" ]
}

@test "Skip upgrading Shim and GRUB if the system is not EFI" {
# shellcheck disable=SC2034
USING_UEFI_BOOTLOADER=no

run source "$REAR_SHARE_DIR/finalize/COVE/Debian/620_upgrade_bootloaders.sh"
[ "$status" -eq 0 ]

local expected_output=""
[ "$output" = "$expected_output" ]
}

@test "Skip upgrading Shim and GRUB on Azure" {
function is_cove_in_azure() {
true
}

run source "$REAR_SHARE_DIR/finalize/COVE/Debian/620_upgrade_bootloaders.sh"
[ "$status" -eq 0 ]

local expected_output=""
[ "$output" = "$expected_output" ]
}

@test "Skip upgrading Shim and GRUB if the system is EFI stub" {
# shellcheck disable=SC2034
EFI_STUB=yes

run source "$REAR_SHARE_DIR/finalize/COVE/Debian/620_upgrade_bootloaders.sh"
[ "$status" -eq 0 ]

local expected_output=""
[ "$output" = "$expected_output" ]
}

@test "Skip upgrading Shim and GRUB if the bootloader is not shim" {
# shellcheck disable=SC2034
UEFI_BOOTLOADER=/boot/efi/EFI/debian/grubx64.efi

run source "$REAR_SHARE_DIR/finalize/COVE/Debian/620_upgrade_bootloaders.sh"
[ "$status" -eq 0 ]

local expected_output=""
[ "$output" = "$expected_output" ]
}
Loading