Skip to content

Commit

Permalink
Refactor logic and bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Victoremepunto committed Nov 16, 2023
1 parent bc3b963 commit e9c91a9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ get_base_image_tag() {

tag=$(cat "${BASE_IMAGE_FILES[@]}" | sha256sum | head -c 8)

if ! _base_image_files_unchanged; then
if _base_image_files_changed; then
CICD_IMAGE_BUILDER_IMAGE_TAG="$tag"
tag=$(cicd::image_builder::get_image_tag)
fi
Expand Down Expand Up @@ -43,11 +43,11 @@ build_base_image() {
cicd::image_builder::build_and_push
}

_base_image_files_unchanged() {
_base_image_files_changed() {

local target_branch=${ghprbTargetBranch:-master}

git diff --quiet "${BASE_IMAGE_FILES[@]}" "$target_branch"
! git diff --quiet "$target_branch" -- "${BASE_IMAGE_FILES[@]}"
}

build_main_image() {
Expand Down

0 comments on commit e9c91a9

Please sign in to comment.