Skip to content

Commit

Permalink
packaging: Adapt get_last_modification()
Browse files Browse the repository at this point in the history
The function is returning "" when called from the script used to cache
the artefacts and one difference noted between this version and the
already working one from the CCv0 is that we make sure to `pushd
${repo_root_dir}` in the CCv0 version.

Let's give it a try here and see if it solves the issue.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
  • Loading branch information
fidencio committed Mar 17, 2023
1 parent 82a04db commit fbf891f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/packaging/scripts/lib.sh
Expand Up @@ -106,13 +106,15 @@ get_kata_hash() {
get_last_modification() {
local file="${1}"

pushd ${repo_root_dir} &> /dev/null
# This is a workaround needed for when running this code on Jenkins
git config --global --add safe.directory ${repo_root_dir} &> /dev/null

dirty=""
[ $(git status --porcelain | grep "${file#${repo_root_dir}/}" | wc -l) -gt 0 ] && dirty="-dirty"

echo "$(git log -1 --pretty=format:"%H" ${file})${dirty}"
popd &> /dev/null
}

# $1 - The tag to be pushed to the registry
Expand Down

0 comments on commit fbf891f

Please sign in to comment.